Skip to content

Commit ff7d2f5

Browse files
committed
Merge remote-tracking branch 'origin/develop' into samples/owls-70382
2 parents 12d77c9 + d175b7c commit ff7d2f5

File tree

71 files changed

+1910
-1644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1910
-1644
lines changed

integration-tests/README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,29 @@ Quick test use cases.
2626
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
2727
7. cluster scale up/down using Operator REST endpoint, webapp load balancing should adjust accordingly. (run.sh does scaling by editing the replicas in domain-custom-resource.yaml.)
2828
8. Operator life cycle(destroy and create) should not impact the running domain
29+
9. verify liveness probe by killing managed server 1 process 3 times to kick pod auto-restart
30+
10. shutdown the domain by changing domain serverStartPolicy to NEVER
2931

3032
Full test use cases
3133

32-
* keep the first domain and operator running
34+
* keep the first operator running
3335
* create another domain domain2 in default namespace and verify the domain by doing the checks 2 - 5 listed in quick test
34-
* destroy domain domain2
36+
* shutdown and delete domain domain2
3537
* create another domain domain3 with dynamic cluster using WDT in test1 namespace and verify the domain by doing the checks 2 - 5 listed in quick test
3638
* verify cluster scaling by doing scale up for domain3 using WLDF scaling
37-
* destroy domain domain3
39+
* shutdown and delete domain domain3
3840
* create another operator operator2 which manages test2 namespace and verify domain1 is not affected
39-
* create another domain domain4 with Configured cluster using WDT in test2 namespace and verify the domain by doing the checks 2 - 5 listed in quick test
40-
* verify scaling for domain4 cluster from 2 to 3 servers and back to 2, plus verify no impact on domain1
41-
* cycle domain1 down and back up, plus verify no impact on domain4
42-
* create domain5 in the default namespace with serverStartPolicy="ADMIN_ONLY", and verify that only admin server is created. on Jenkins, this domain will also test NFS instead of HOSTPATH PV storage
43-
* create domain6 in the default namespace with pvReclaimPolicy="Recycle", and verify that the PV is deleted once the domain and PVC are deleted
44-
* test managed server 1 pod auto-restart in domain1
45-
* destroy domain1
46-
* test that create domain fails when its pv is already populated by a shutdown domain
47-
* create another domain domain7 with APACHE load balancer and access admin console via LB port.
48-
* create another domain domain8 with mostly default values from sample domain inputs, mainly exposeAdminT3Channel and exposeAdminNodePort which are false by default and verify domain startup and cluster scaling using operator rest endpoint works.
41+
* create another domain domain4 with dynamic cluster in default namespace and domain domain5 with Configured cluster using WDT in test2 namespace and verify the domain by doing the checks 2 - 5 listed in quick test
42+
* verify scaling for domain5 cluster from 2 to 3 servers and back to 2, plus verify no impact on domain4
43+
* cycle domain4 down and back up, plus verify no impact on domain5
44+
* shutdown and delete both domain4 and domain5
45+
* create domain6 in the default namespace with serverStartPolicy="ADMIN_ONLY", and verify that only admin server is created. on Jenkins, this domain will also test NFS instead of HOSTPATH PV storage
46+
* shutdown and delete domain6
47+
* create domain7 in the default namespace with pvReclaimPolicy="Recycle", and verify that the PV is deleted once the domain and PVC are deleted
48+
* shutdown and delete domain7
49+
* create domain domain8 and test that create domain fails when its pv is already populated by a shutdown domain
50+
* create another domain domain9 with APACHE load balancer and access admin console via LB port. shutdown domain.
51+
* create another domain domain10 with mostly default values from sample domain inputs, mainly exposeAdminT3Channel and exposeAdminNodePort which are false by default and verify domain startup and cluster scaling using operator rest endpoint works.
4952

5053

5154
# Directory Configuration and Structure

integration-tests/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@
6666
<artifactId>snakeyaml</artifactId>
6767
<version>1.21</version>
6868
</dependency>
69-
</dependencies>
69+
<dependency>
70+
<groupId>io.kubernetes</groupId>
71+
<artifactId>client-java</artifactId>
72+
<scope>test</scope>
73+
</dependency>
74+
</dependencies>
7075

7176

7277
<profiles>

integration-tests/src/test/java/oracle/kubernetes/operator/ITOperator.java

Lines changed: 97 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class ITOperator extends BaseTest {
2828
// property file used to customize operator properties for operator inputs yaml
2929
private static String op1YamlFile = "operator1.yaml";
3030
private static String op2YamlFile = "operator2.yaml";
31+
private static final String opForDelYamlFile1 = "operator_del1.yaml";
32+
private static final String opForDelYamlFile2 = "operator_del2.yaml";
3133

3234
// property file used to customize domain properties for domain inputs yaml
3335
private static String domain1YamlFile = "domain1.yaml";
@@ -38,12 +40,19 @@ public class ITOperator extends BaseTest {
3840
private static String domain6YamlFile = "domain6.yaml";
3941
private static String domain7YamlFile = "domain7.yaml";
4042
private static String domain8YamlFile = "domain8.yaml";
43+
private static final String domain1ForDelValueYamlFile = "domain_del_1.yaml";
44+
private static final String domain2ForDelValueYamlFile = "domain_del_2.yaml";
45+
private static final String domain3ForDelValueYamlFile = "domain_del_3.yaml";
46+
private static String domain9YamlFile = "domain9.yaml";
47+
private static String domain10YamlFile = "domain10.yaml";
4148

4249
// property file used to configure constants for integration tests
4350
private static String appPropsFile = "OperatorIT.properties";
4451

4552
private static Operator operator1, operator2;
46-
private static Domain domain1;
53+
54+
private static Operator operatorForDel1;
55+
private static Operator operatorForDel2;
4756

4857
/**
4958
* This method gets called only once before any of the test methods are executed. It does the
@@ -93,9 +102,9 @@ public void test1CreateFirstOperatorAndDomain() throws Exception {
93102

94103
logTestBegin("test1CreateFirstOperatorAndDomain");
95104
testCreateOperatorManagingDefaultAndTest1NS();
96-
domain1 = testAllUseCasesForADomain(operator1, domain1YamlFile);
105+
Domain domain1 = testAllUseCasesForADomain(operator1, domain1YamlFile);
97106
domain1.testWlsLivenessProbe();
98-
domain1.destroy();
107+
domain1.shutdownUsingServerStartPolicy();
99108

100109
logger.info("SUCCESS - test1CreateFirstOperatorAndDomain");
101110
}
@@ -159,34 +168,31 @@ public void test5CreateConfiguredDomainInTest2NS() throws Exception {
159168
if (operator1 == null) {
160169
operator1 = TestUtils.createOperator(op1YamlFile);
161170
}
162-
if (domain1 == null) {
163-
domain1 = TestUtils.createDomain(domain1YamlFile);
164-
} else {
165-
domain1.create();
166-
}
171+
Domain domain4 = TestUtils.createDomain(domain4YamlFile);
172+
167173
logger.info("Checking if operator2 is running, if not creating");
168174
if (operator2 == null) {
169175
operator2 = TestUtils.createOperator(op2YamlFile);
170176
}
171-
// create domain4
172-
Domain domain4 = testDomainCreation(domain4YamlFile);
177+
// create domain5 with configured cluster
178+
Domain domain5 = testDomainCreation(domain5YamlFile);
173179

174-
logger.info("Verify the only remaining running domain domain1 is unaffected");
175-
domain1.verifyDomainCreated();
180+
logger.info("Verify the only remaining running domain domain4 is unaffected");
181+
domain4.verifyDomainCreated();
176182

177-
testClusterScaling(operator2, domain4);
183+
testClusterScaling(operator2, domain5);
178184

179-
logger.info("Verify the only remaining running domain domain1 is unaffected");
180-
domain1.verifyDomainCreated();
185+
logger.info("Verify the only remaining running domain domain4 is unaffected");
186+
domain4.verifyDomainCreated();
181187

182-
logger.info("Destroy and create domain1 and verify no impact on domain4");
183-
domain1.destroy();
184-
domain1.create();
188+
logger.info("Destroy and create domain4 and verify no impact on domain5");
189+
domain4.destroy();
190+
domain4.create();
185191

186-
logger.info("Verify no impact on domain4");
187-
domain4.verifyDomainCreated();
192+
logger.info("Verify no impact on domain5");
193+
domain5.verifyDomainCreated();
194+
domain5.destroy();
188195
domain4.destroy();
189-
domain1.destroy();
190196
logger.info("SUCCESS - test5CreateConfiguredDomainInTest2NS");
191197
}
192198

@@ -200,10 +206,10 @@ public void test6CreateDomainWithStartPolicyAdminOnly() throws Exception {
200206
if (operator1 == null) {
201207
operator1 = TestUtils.createOperator(op1YamlFile);
202208
}
203-
logger.info("Creating Domain domain5 & verifing the domain creation");
204-
// create domain5
205-
Domain domain5 = TestUtils.createDomain(domain5YamlFile);
206-
domain5.destroy();
209+
logger.info("Creating Domain domain6 & verifing the domain creation");
210+
// create domain6
211+
Domain domain6 = TestUtils.createDomain(domain6YamlFile);
212+
domain6.destroy();
207213
logger.info("SUCCESS - test6CreateDomainWithStartPolicyAdminOnly");
208214
}
209215

@@ -217,47 +223,46 @@ public void test7CreateDomainPVReclaimPolicyRecycle() throws Exception {
217223
if (operator1 == null) {
218224
operator1 = TestUtils.createOperator(op1YamlFile);
219225
}
220-
logger.info("Creating Domain domain6 & verifing the domain creation");
221-
// create domain6
222-
Domain domain6 = TestUtils.createDomain(domain6YamlFile);
223-
domain6.shutdown();
224-
domain6.deletePVCAndCheckPVReleased();
226+
logger.info("Creating Domain domain7 & verifing the domain creation");
227+
// create domain7
228+
Domain domain7 = TestUtils.createDomain(domain7YamlFile);
229+
domain7.shutdown();
230+
domain7.deletePVCAndCheckPVReleased();
225231
logger.info("SUCCESS - test7CreateDomainPVReclaimPolicyRecycle");
226232
}
227233

228234
@Test
229-
public void test9CreateDomainOnExistingDir() throws Exception {
235+
public void test8CreateDomainOnExistingDir() throws Exception {
230236
Assume.assumeFalse(
231237
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
232238

233-
logTestBegin("test9CreateDomainOnExistingDir");
239+
logTestBegin("test8CreateDomainOnExistingDir");
234240
if (operator1 == null) {
235241
operator1 = TestUtils.createOperator(op1YamlFile);
236242
}
237-
if (domain1 == null) {
238-
domain1 = TestUtils.createDomain(domain1YamlFile);
239-
// create domain on existing dir
240-
domain1.destroy();
241-
}
242-
logger.info("domain1 " + domain1);
243-
domain1.createDomainOnExistingDirectory();
244-
logger.info("SUCCESS - test9CreateDomainOnExistingDir");
243+
244+
Domain domain8 = TestUtils.createDomain(domain8YamlFile);
245+
// create domain on existing dir
246+
domain8.destroy();
247+
248+
domain8.createDomainOnExistingDirectory();
249+
logger.info("SUCCESS - test8CreateDomainOnExistingDir");
245250
}
246251

247252
// @Test
248253
public void testACreateDomainApacheLB() throws Exception {
249254
Assume.assumeFalse(
250255
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
251256
logTestBegin("testACreateDomainApacheLB");
252-
logger.info("Creating Domain domain7 & verifing the domain creation");
257+
logger.info("Creating Domain domain9 & verifing the domain creation");
253258
if (operator1 == null) {
254259
operator1 = TestUtils.createOperator(op1YamlFile);
255260
}
256261

257262
// create domain7
258-
Domain domain7 = TestUtils.createDomain(domain7YamlFile);
259-
domain7.verifyAdminConsoleViaLB();
260-
domain7.destroy();
263+
Domain domain9 = TestUtils.createDomain(domain9YamlFile);
264+
domain9.verifyAdminConsoleViaLB();
265+
domain9.destroy();
261266
logger.info("SUCCESS - testACreateDomainApacheLB");
262267
}
263268

@@ -266,17 +271,61 @@ public void testBCreateDomainWithDefaultValuesInSampleInputs() throws Exception
266271
Assume.assumeFalse(
267272
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
268273
logTestBegin("testBCreateDomainWithDefaultValuesInSampleInputs");
269-
logger.info("Creating Domain domain8 & verifing the domain creation");
274+
logger.info("Creating Domain domain10 & verifing the domain creation");
270275
if (operator1 == null) {
271276
operator1 = TestUtils.createOperator(op1YamlFile);
272277
}
273278

274-
// create domain8
275-
Domain domain8 = testAllUseCasesForADomain(operator1, domain8YamlFile);
276-
domain8.destroy();
279+
// create domain10
280+
Domain domain10 = testAllUseCasesForADomain(operator1, domain10YamlFile);
281+
domain10.destroy();
277282
logger.info("SUCCESS - testBCreateDomainWithDefaultValuesInSampleInputs");
278283
}
279284

285+
@Test
286+
public void testDeleteOneDomain() throws Exception {
287+
Assume.assumeFalse(
288+
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
289+
logTestBegin("Deleting one domain.");
290+
291+
if (operatorForDel1 == null) {
292+
logger.info("About to create operator");
293+
operatorForDel1 = TestUtils.createOperator(opForDelYamlFile1);
294+
}
295+
final Domain domain = TestUtils.createDomain(domain1ForDelValueYamlFile);
296+
TestUtils.verifyBeforeDeletion(domain);
297+
298+
logger.info("About to delete domain: " + domain.getDomainUid());
299+
TestUtils.deleteWeblogicDomainResources(domain.getDomainUid());
300+
301+
TestUtils.verifyAfterDeletion(domain);
302+
}
303+
304+
@Test
305+
public void testDeleteTwoDomains() throws Exception {
306+
Assume.assumeFalse(
307+
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
308+
logTestBegin("Deleting two domains.");
309+
310+
if (operatorForDel2 == null) {
311+
logger.info("About to create operator");
312+
operatorForDel2 = TestUtils.createOperator(opForDelYamlFile2);
313+
}
314+
final Domain domainDel1 = TestUtils.createDomain(domain2ForDelValueYamlFile);
315+
final Domain domainDel2 = TestUtils.createDomain(domain3ForDelValueYamlFile);
316+
317+
TestUtils.verifyBeforeDeletion(domainDel1);
318+
TestUtils.verifyBeforeDeletion(domainDel2);
319+
320+
final String domainUidsToBeDeleted =
321+
domainDel1.getDomainUid() + "," + domainDel2.getDomainUid();
322+
logger.info("About to delete domains: " + domainUidsToBeDeleted);
323+
TestUtils.deleteWeblogicDomainResources(domainUidsToBeDeleted);
324+
325+
TestUtils.verifyAfterDeletion(domainDel1);
326+
TestUtils.verifyAfterDeletion(domainDel2);
327+
}
328+
280329
private void testCreateOperatorManagingDefaultAndTest1NS() throws Exception {
281330
logger.info("Creating Operator & waiting for the script to complete execution");
282331
// create operator1

0 commit comments

Comments
 (0)