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.
@@ -305,7 +305,7 @@ $RESULT_ROOT/acceptance_test_tmp is archived under $RESULT_ROOT/acceptance_test_
305
305
306
306
$PV_ROOT/acceptance_test_pv is archived under $PV_ROOT/acceptance_test_pv_archive
307
307
308
-
On Wercker, these logs can be downloaded by clicking "Download artifact" on cleanup and store step.
308
+
On Wercker, these logs can be downloaded by clicking "Download artifact" on cleanup and store step.
309
309
310
310
# How to add a new test
311
311
@@ -318,3 +318,18 @@ ITOperator.java - take a look at this test for reference
318
318
# Future enhancement
319
319
320
320
Add functional tests
321
+
322
+
## Troubleshooting
323
+
324
+
The integration tests are not completely independent of the environment.
325
+
326
+
You may run into one or more of the following errors when you attempt to execute the command:
327
+
```
328
+
mvn clean verify -P java-integration-tests 2>&1 | tee log.txt
329
+
```
330
+
1.`[ERROR] No permision to create directory /scratch/...`
331
+
332
+
There are a couple ways to resolve this issue:
333
+
334
+
* Create a world writable directory named `/scratch`.
335
+
* 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.
Copy file name to clipboardExpand all lines: kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,3 +213,16 @@ Access Modes: RWX
213
213
Events: <none>
214
214
215
215
```
216
+
217
+
## Troubleshooting
218
+
219
+
* Message: `[ERROR] The weblogicDomainStoragePath parameter in kubernetes/samples/scripts/create-weblogic-domain-pv-pvc/create-pv-pvc-inputs.yaml is missing, null or empty`
220
+
Edit the file and set the value of the field. This value must be a directory that is world writable.
221
+
Optionally, follow these steps to tighten permissions on the named directory after you run the sample the first time:
222
+
223
+
* Become the root user.
224
+
*`ls -nd $value-of-weblogicDomainStoragePath`
225
+
* Note the values of the third and fourth field of the output.
Copy file name to clipboardExpand all lines: kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/README.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -384,3 +384,51 @@ Sometimes in production, but most likely in testing environments, you might want
384
384
$ kubectl create -f delete-domain-job.yaml
385
385
386
386
```
387
+
## Troubleshooting
388
+
389
+
1. Message: `status on iteration 20 of 20
390
+
pod domain1-create-weblogic-sample-domain-job-4qwt2 status is Pending
391
+
The create domain job is not showing status completed after waiting 300 seconds.`
392
+
The most likely cause is related to the value of `persistentVolumeClaimName`, defined in `domain-home-on-pv/create-domain-inputs.yaml`. To determine if this is the problem:
393
+
394
+
* Execute `kubectl get all --all-namespaces` to find the name of the `create-weblogic-sample-domain-job`.
395
+
* Execute `kubectl describe pod <name-of-create-weblogic-sample-domain-job>` to see if there is an event that has text similar to `persistentvolumeclaim "domain1-weblogic-sample-pvc" not found`.
396
+
* Find the name of the PVC that was created by executing [create-pv-pvc.sh](../../create-weblogic-domain-pv-pvc/README.md), using `kubectl describe pvc`. It is likely to be `weblogic-sample-pvc`.
397
+
* Change the value of `persistentVolumeClaimName` to match the name created when you executed [create-pv-pvc.sh](../../create-weblogic-domain-pv-pvc/README.md).
398
+
* Rerun the `create-domain.sh` script with the same arguments as you did before.
399
+
* Verify that the operator is deployed. Use the command:
400
+
```
401
+
kubectl get all --all-namespaces
402
+
```
403
+
Look for lines similar to:
404
+
```
405
+
weblogic-operator1 pod/weblogic-operator-
406
+
```
407
+
If you do not find something similar in the output, the WebLogic Operator for Kubernetes may not have been installed completely. Review the operator [installation instructions](../../../../../site/install.md).
408
+
409
+
410
+
2. Message: `ERROR: Unable to create folder /shared/domains`
411
+
The most common cause is a poor choice of value for `weblogicDomainStoragePath` in the input file used when you executed:
412
+
```
413
+
create-pv-pvc.sh
414
+
```
415
+
You should [delete the resources for your sample domain](../../delete-domain/README.md), correct the value in that file, and rerun the commands to create the PV/PVC and the credential before you attempt to rerun:
416
+
```
417
+
create-domain.sh
418
+
```
419
+
A correct value for `weblogicDomainStoragePath` will meet the following requirements:
420
+
421
+
* Must be the name of a directory.
422
+
* The directory must be world writable.
423
+
424
+
Optionally, follow these steps to tighten permissions on the named directory after you run the sample the first time:
425
+
426
+
* Become the root user.
427
+
*`ls -nd $value-of-weblogicDomainStoragePath`
428
+
* Note the values of the third and fourth field of the output.
3. Message: `ERROR: The create domain job will not overwrite an existing domain. The domain folder /shared/domains/domain1 already exists`
434
+
You will see this message if the directory `domains/domain1` exists in the directory named as the value of `weblogicDomainStoragePath` in `create-pv-pvc-inputs.yaml`. For example, if the value of `weblogicDomainStoragePath` is `/tmp/wls-op-4-k8s`, you would need to remove (or move) `/tmp/wls-op-4-k8s/domains/domain1`.
0 commit comments