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
+60-45Lines changed: 60 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,87 +1,87 @@
1
1
# Integration Tests for Oracle WebLogic Server Kubernetes Operator
2
2
3
-
This documentation describes the functional use cases that are covered in integration testing for the Oracle WebLogic Server Kubernetes Operator. The tests are written in Java (JUnit tests) and driven by Maven profile.
3
+
This documentation describes the functional use cases that are covered in integration testing for the Oracle WebLogic Server Kubernetes Operator. The tests are written in Java (JUnit tests) and driven by Maven profile.
4
4
5
5
# Environments
6
6
7
-
The tests currently run in three modes: "Wercker", "Jenkins", and "standalone" Oracle Linux, where the mode is controlled by the WERCKER and JENKINS environment variables described below. The default is "standalone".
7
+
The tests currently run in three modes: "Wercker", "Jenkins", and "standalone" Oracle Linux, where the mode is controlled by the `WERCKER` and `JENKINS` environment variables described below. The default is "standalone".
8
8
9
-
* "Standalone" Oracle Linux, i.e, run the tests manually with mvn command.
10
-
* Wercker - https://app.wercker.com/Oracle/weblogic-kubernetes-operator/runs - integration-test-java is the pipeline name
11
-
* Jenkins - http://wls-jenkins.us.oracle.com/view/weblogic-operator/job/weblogic-kubernetes-operator-javatest/ - Jenkins Run is restricted to Oracle Internal development Process
9
+
* "Standalone" Oracle Linux, i.e, run the tests manually with the `mvn` command.
10
+
* Wercker - https://app.wercker.com/Oracle/weblogic-kubernetes-operator/runs - `integration-test-java` is the pipeline name.
11
+
* Jenkins - http://wls-jenkins.us.oracle.com/view/weblogic-operator/job/weblogic-kubernetes-operator-javatest/ - Jenkins Run is restricted to Oracle Internal development process.
12
12
13
-
Wercker runs only Quick test use cases, Jenkins run both Quick and Full test use cases.
13
+
Wercker runs only Quick test use cases, Jenkins runs both Quick and Full test use cases.
14
14
15
15
# Use Cases
16
16
17
17
Java integration tests cover the below use cases:
18
18
19
-
Quick test use cases -
19
+
Quick test use cases
20
20
21
21
|||
22
22
| --- | --- |
23
-
| Operator Configuration | operator1 deployed in weblogic-operator1 namespace and manages domains in default and test1 namespaces |
24
-
| Domain Configuration | Domain on PV using WLST, traefik load balancer |
23
+
| Operator Configuration | operator1 deployed in `weblogic-operator1` namespace and manages domains in `default` and `test1` namespaces |
24
+
| Domain Configuration | Domain on PV using WLST, Traefik load balancer |
25
25
26
26
Basic Use Cases
27
27
28
-
1.create operator operator1 which manages default and test1 namespaces, verify its deployed successfully, pod created, operator Ready and verify external REST service if configured
29
-
2.create domain domain1 in default namespace and verify the pods, services are created and servers are in Ready
30
-
3.verify admin external service by accessing admin REST endpoint with nodeport in URL
31
-
4.verify admin t3 channel port by exec into the admin pod and deploying webapp using the channel port for WLST
32
-
5.verify web app load balancing by accessing the webapp using loadBalancerWebPort
28
+
1.Create operator `operator1` which manages `default` and `test1` namespaces, verify it's deployed successfully, pods created, operator ready and verify external REST service, if configured.
29
+
2.Create domain `domain1` in `default` namespace and verify the pods, services are created and servers are in ready state.
30
+
3.Verify the admin external service by accessing the admin REST endpoint with `nodeport` in URL.
31
+
4.Verify admin t3 channel port by exec into the admin pod and deploying webapp using the channel port for WLST.
32
+
5.Verify web app load balancing by accessing the webapp using `loadBalancerWebPort`.
33
33
34
34
Advanced Use Cases
35
35
36
-
6.verify domain life cycle(destroy and create) should not any impact on Operator managing the domain and web app load balancing and admin external service
37
-
7.cluster scale up/down using Operator REST endpoint, webapp load balancing should adjust accordingly.
38
-
8. Operator life cycle(destroy and create) should not impact the running domain
36
+
6.Verify domain life cycle(destroy and create) should not have any impact on operator managing the domain and web app load balancing and admin external service.
37
+
7.Cluster scale up/down using operator REST endpoint, webapp load balancing should adjust accordingly.
38
+
8. Operator life cycle(destroy and create) should not impact the running domain.
39
39
40
-
Also the below use cases are covered for Quick test
40
+
Also the below use cases are covered for Quick test:
41
41
42
-
9.verify liveness probe by killing managed server 1 process 3 times to kick pod auto-restart
43
-
10.shutdown the domain by changing domain serverStartPolicy to NEVER
42
+
9.Verify the liveness probe by killing managed server 1 process 3 times to kick pod auto-restart.
43
+
10.Shutdown the domain by changing domain `serverStartPolicy` to `NEVER`.
44
44
45
-
Full test use cases -
45
+
Full test use cases
46
46
47
47
|||
48
48
| --- | --- |
49
-
| Operator Configuration | operator2 deployed in weblogic-operator2 namespace and manages domains test2 namespace |
50
-
| Domain Configuration | Domain on PV using WDT, Domain with serverStartPolicyADMIN_ONLY, Domain with auto and custom situational configuration, Two domains managed by two operators, Domain with Recycle weblogicDomainStorageReclaimPolicy, Domain with default sample values |
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.|
51
51
52
52
53
53
Basic Use Cases described above are verified in all the domain configurations. Also the below use cases are covered:
54
54
55
55
| Domain | Use Case |
56
56
| --- | --- |
57
57
| 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
-
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
+
64
64
65
65
# Directory Configuration and Structure
66
66
67
67
Directory structure of source code:
68
68
69
-
A new module "integration-tests" is added to the Maven project weblogic-kubernetes-operator.
69
+
A new module "integration-tests" is added to the Maven project `weblogic-kubernetes-operator`.
70
70
71
-
weblogic-kubernetes-operator/integration-tests - location of module pom.xml
72
-
weblogic-kubernetes-operator/integration-tests/src/test/java - integration test(JUnit) classes and utility classes
73
-
weblogic-kubernetes-operator/integration-tests/src/test/resources - properties, yaml files(see Configuration Files section) and other scripts
71
+
`weblogic-kubernetes-operator/integration-tests` - location of module pom.xml
72
+
`weblogic-kubernetes-operator/integration-tests/src/test/java` - integration test(JUnit) classes and utility classes
73
+
`weblogic-kubernetes-operator/integration-tests/src/test/resources` - properties, YAML files(see Configuration Files section) and other scripts.
74
74
75
75
Directory structure used for the test run:
76
76
77
-
Main external env vars:
77
+
Main external `env vars`:
78
78
79
79
| Variable | Description |
80
80
| --- | --- |
81
81
| RESULT_ROOT | Root path for local test files. |
82
82
| PV_ROOT | Root NFS path behind PV/C directories. This must have permissions suitable for WL pods to add files |
83
83
84
-
Defaults for RESULT_ROOT & PV_ROOT:
84
+
Defaults for `RESULT_ROOT` & `PV_ROOT`:
85
85
86
86
| Test Mode | RESULT_ROOT | PV_ROOT | Where initialized |
87
87
| --- | --- | --- | --- |
@@ -173,7 +173,7 @@ Integration test classes:
173
173
174
174
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
175
176
-
staticPrepare() - initializes the application properties from OperatorIT.properties and creates resultRoot, pvRoot, userprojectsDir directories by calling initialize() method from the base class BaseTest.
176
+
staticPrepare() - initializes the application properties from OperatorIT.properties and creates resultRoot, pvRoot, userprojectsDir directories by calling initialize() method from the base class BaseTest.
177
177
178
178
staticUnPrepare() - releases the cluster lease on wercker env.
@@ -306,7 +306,7 @@ $RESULT_ROOT/acceptance_test_tmp is archived under $RESULT_ROOT/acceptance_test_
306
306
307
307
$PV_ROOT/acceptance_test_pv is archived under $PV_ROOT/acceptance_test_pv_archive
308
308
309
-
On Wercker, these logs can be downloaded by clicking "Download artifact" on cleanup and store step.
309
+
On Wercker, these logs can be downloaded by clicking "Download artifact" on cleanup and store step.
310
310
311
311
# How to add a new test
312
312
@@ -319,3 +319,18 @@ ITOperator.java - take a look at this test for reference
319
319
# Future enhancement
320
320
321
321
Add functional tests
322
+
323
+
## Troubleshooting
324
+
325
+
The integration tests are not completely independent of the environment.
326
+
327
+
You may run into one or more of the following errors when you attempt to execute the command:
328
+
```
329
+
mvn clean verify -P java-integration-tests 2>&1 | tee log.txt
330
+
```
331
+
1.`[ERROR] No permision to create directory /scratch/...`
332
+
333
+
There are a couple ways to resolve this issue:
334
+
335
+
* Create a world writable directory named `/scratch`.
336
+
* Create some other world writable directory and then define the environment variables `RESULT_ROOT` and `PV_ROOT` to point to that directory. If you want, you can create two directories to keep things separated. See [Directory Configuration and Structure](#directory-configuration-and-structure) for more details.
0 commit comments