You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integration-tests/README.md
+58-28Lines changed: 58 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Wercker runs only Quick test use cases, Jenkins runs both Quick and Full test us
16
16
17
17
Java integration tests cover the below use cases:
18
18
19
-
Quick test use cases
19
+
Quick test Configuration & Use Cases -
20
20
21
21
|||
22
22
| --- | --- |
@@ -42,25 +42,28 @@ Also the below use cases are covered for Quick test:
42
42
9. Verify the liveness probe by killing managed server 1 process 3 times to kick pod auto-restart.
43
43
10. Shutdown the domain by changing domain `serverStartPolicy` to `NEVER`.
44
44
45
-
Full test use cases
45
+
46
+
Full test Configuration & Use Cases - Runs Quick test Configuration & Use cases and the below
46
47
47
48
|||
48
49
| --- | --- |
49
-
| Operator Configuration | operator2 deployed in `weblogic-operator2` namespace and manages domains `test2` namespace.|
50
-
| Domain Configuration | Domain on PV using WDT; domain with `serverStartPolicy``ADMIN_ONLY`; domain with auto and custom situational configuration; two domains managed by two operators; domain with recycle `weblogicDomainStorageReclaimPolicy`; domain with default sample values.|
50
+
| Operator Configuration | operator2 deployed in weblogic-operator2 namespace and manages domains test2 namespace |
51
+
| Domain Configuration | Domain on PV using WDT <p> Domain home in image using WLST <p> Domain home in image using WDT <p> Domain with serverStartPolicyADMIN_ONLY <p> Domain with auto and custom situational configuration <p> Two domains managed by two operators <p> Domain with Recycle weblogicDomainStorageReclaimPolicy <p> Domain with default sample values |
51
52
52
53
53
54
Basic Use Cases described above are verified in all the domain configurations. Also the below use cases are covered:
54
55
55
56
| Domain | Use Case |
56
57
| --- | --- |
57
58
| Domain on PV using WDT | WLDF scaling |
58
-
| Domain with ADMIN_ONLY | Making sure only admin server is started and managed servers are not started. Shutdown domain by deleting domain CRD. Create domain on existing PV dir, pv is already populated by a shutdown domain. |
59
-
| Domain with situational config | Create domain with listen address not set for admin server and t3 channel/NAP and incorrect file for admin server log location. Introspector should override these with sit-config automatically. Also, with some junk value for t3 channel public address and using custom situational config override replace with valid public address using secret. Also, on Jenkins this domain uses NFS instead of HOSTPATH PV storage. |
60
-
| Two domains managed by two operators | Verify scaling and restart of one domain doesn't impact another domain. Delete domain resources using delete script from samples. |
61
-
| Domain with Recycle policy | Create domain with pvReclaimPolicy="Recycle" Verify that the PV is deleted once the domain and PVC are deleted. |
62
-
| Domain with default sample values | Create domain using mostly default values for inputs. |
63
-
59
+
| Domain with ADMIN_ONLY | making sure only admin server is started and managed servers are not started. Shutdown domain by deleting domain CRD. Create domain on existing PV dir, pv is already populated by a shutdown domain. |
60
+
| Domain with situational config | create domain with listen address not set for admin server and t3 channel/NAP and incorrect file for admin server log location. Introspector should override these with sit-config automatically. Also, with some junk value for t3 channel public address and using custom situational config override replace with valid public address using secret. Also, on Jenkins this domain uses NFS instead of HOSTPATH PV storage |
61
+
| Two domains managed by two operators | verify scaling and restart of one domain doesn't impact another domain. Delete domain resources using delete script from samples. |
62
+
| Domain with Recycle policy | create domain with pvReclaimPolicy="Recycle" Verify that the PV is deleted once the domain and PVC are deleted |
63
+
| Domain with default sample values | create domain using mostly default values for inputs |
64
+
| Domain home in image using WLST | cluster scaling |
65
+
| Domain home in image using WDT | cluster scaling |
66
+
64
67
65
68
# Directory Configuration and Structure
66
69
@@ -166,10 +169,21 @@ Certain properties like weblogicDomainStoragePath, image, externalOperatorCert a
166
169
167
170
# How does it work
168
171
169
-
When the tests are run manually with mvn command on hosted Linux, WebLogic image store/oracle/weblogic:12.2.1.3 is pulled from docker hub or uses local image if one exists. Server jre images are pulled from a local repository wlsldi-v2.docker.oraclecorp.com. Operator image is built with the git branch from where the mvn command is executed.
170
-
All the tests that start with IT*.java are run. The test builds the operator, runs a series of tests and archives the results into tar.gz files upon completion.
171
-
172
-
Integration test classes:
172
+
When the tests are run with mvn command,
173
+
- cleanup the test tmp files, PV dir and k8s artifacts created for the test if any
174
+
- creates the required secrets to pull the WL image from docker hub
175
+
- Operator image is built with the git branch from where the mvn command is executed.
176
+
- creates Operator and verifies operator is running
177
+
- creates Domain crd using samples
178
+
- verifies the domain is started and servers are ready, services are created
179
+
- executes the basic and advanced use cases
180
+
- shutdown the domain
181
+
- archive logs and results
182
+
- cleanup the tmp files, PV dir and k8s artifacts created for the test
183
+
184
+
All the tests that start with IT*.java in integration-tests/src/test/java are run.
185
+
186
+
**Integration test classes:**
173
187
174
188
When the integration test class ITOperator is executed, staticPrepare() method is called once before any of the test methods in the class and staticUnPrepare() method once at the end.
175
189
@@ -179,27 +193,43 @@ staticUnPrepare() - releases the cluster lease on wercker env.
Operator - constructor takes yaml file with operator properties and generates operator valus yaml with required properties and certs, creates service account, namespace and calls helm install using the generated values yaml file. Also contains methods to delete operator release, verify operator created and ready, scale using rest api, verify a given domain via rest, verify external rest service, etc <p>
199
+
Domain - constructor takes Map with domain, LB, PV properties and creates domain crd, LB operator/ingress and PV artifacts using the sample scripts provided in the project. Also contains helper methods to destroy domain by deleting domain crd, verify domain created and servers are ready, deploy webapp, verify load balancing of http requests, etc <p>
200
+
PersistentVolume - runs k8s job to create PV directory and creates PV and PVC using sample scripts <p>
201
+
LoadBalancer - creates load balancer, currently TREFIK and VOYAGER are supported <p>
202
+
Secret - creates a k8s secret <p>
203
+
TestUtils - mostly runs kubectl commands. Contains utility methods to check if a pod is created, ready, deleted, service created, get pod restart cnt, get cluster replica, delete PVC, check PV released, create rbac policy, create wldf module, etc. <p>
204
+
ExecCommand - Class for executing shell commands from java <p>
205
+
ExecResult - Class that holds the results of using java to exec a command (i.e. exit value, stdout and stderr) <p>
206
+
K8sTestUtils - uses k8s java client api, this is used only for delete domain use cases for now. <p>
189
207
190
208
# How to run the Java integration tests
191
209
192
210
* Maven and latest Git should be in PATH
193
211
* export JAVA_HOME
194
-
195
-
Command to run the tests:
212
+
* export WEBLOGIC_IMAGE_NAME and WEBLOGIC_IMAGE_TAG if different from store/oracle/weblogic and 12.2.1.3
213
+
* Setup docker access to WebLogic 12c Images
214
+
215
+
Method 1
216
+
- Setup a personal account on hub.docker.com
217
+
- Then sign in to hub.docker.com and signup for access to WebLogic 12c Images via https://hub.docker.com/_/oracle-weblogic-server-12c
218
+
- Then export the following before running the tests:
219
+
```
220
+
export DOCKER_USERNAME=<docker_username>
221
+
export DOCKER_PASSWORD=<docker_password>
222
+
export DOCKER_EMAIL=<docker_email>
223
+
```
224
+
225
+
Method 2
226
+
- Make sure the weblogic image i.e. store/oracle/weblogic:12.2.1.3 already exists locally in a docker repository the k8s cluster can access
227
+
- Make sure the weblogic image has patch p29135930 (required for the WebLogic Kubernetes Operator).
228
+
- If not, see [https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-patch-wls-for-k8s].
229
+
230
+
231
+
* Command to run the tests:
196
232
```
197
-
export DOCKER_USERNAME=<docker_username>
198
-
export DOCKER_PASSWORD=<docker_password>
199
-
export DOCKER_EMAIL=<docker_email>
200
-
or
201
-
make sure the weblogic image i.e. store/oracle/weblogic:12.2.1.3 already exists locally
202
-
203
233
mvn clean verify -P java-integration-tests 2>&1 | tee log.txt
0 commit comments