Skip to content

Commit 2ed2b74

Browse files
author
Tom Barnes
committed
Merge remote-tracking branch 'origin/develop' into feature/custom-sit-config
2 parents 21310fb + 84c3dff commit 2ed2b74

File tree

24 files changed

+744
-206
lines changed

24 files changed

+744
-206
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: 95 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
private static boolean QUICKTEST;
4958
private static boolean SMOKETEST;
@@ -107,9 +116,9 @@ public void test1CreateFirstOperatorAndDomain() throws Exception {
107116

108117
logTestBegin("test1CreateFirstOperatorAndDomain");
109118
testCreateOperatorManagingDefaultAndTest1NS();
110-
domain1 = testAllUseCasesForADomain(operator1, domain1YamlFile);
119+
Domain domain1 = testAllUseCasesForADomain(operator1, domain1YamlFile);
111120
if (!SMOKETEST) domain1.testWlsLivenessProbe();
112-
if (!SMOKETEST) domain1.destroy();
121+
if (!SMOKETEST) domain1.shutdownUsingServerStartPolicy();
113122

114123
logger.info("SUCCESS - test1CreateFirstOperatorAndDomain");
115124
}
@@ -169,34 +178,31 @@ public void test5CreateConfiguredDomainInTest2NS() throws Exception {
169178
if (operator1 == null) {
170179
operator1 = TestUtils.createOperator(op1YamlFile);
171180
}
172-
if (domain1 == null) {
173-
domain1 = TestUtils.createDomain(domain1YamlFile);
174-
} else {
175-
domain1.create();
176-
}
181+
Domain domain4 = TestUtils.createDomain(domain4YamlFile);
182+
177183
logger.info("Checking if operator2 is running, if not creating");
178184
if (operator2 == null) {
179185
operator2 = TestUtils.createOperator(op2YamlFile);
180186
}
181-
// create domain4
182-
Domain domain4 = testDomainCreation(domain4YamlFile);
187+
// create domain5 with configured cluster
188+
Domain domain5 = testDomainCreation(domain5YamlFile);
183189

184-
logger.info("Verify the only remaining running domain domain1 is unaffected");
185-
domain1.verifyDomainCreated();
190+
logger.info("Verify the only remaining running domain domain4 is unaffected");
191+
domain4.verifyDomainCreated();
186192

187-
testClusterScaling(operator2, domain4);
193+
testClusterScaling(operator2, domain5);
188194

189-
logger.info("Verify the only remaining running domain domain1 is unaffected");
190-
domain1.verifyDomainCreated();
195+
logger.info("Verify the only remaining running domain domain4 is unaffected");
196+
domain4.verifyDomainCreated();
191197

192-
logger.info("Destroy and create domain1 and verify no impact on domain4");
193-
domain1.destroy();
194-
domain1.create();
198+
logger.info("Destroy and create domain4 and verify no impact on domain5");
199+
domain4.destroy();
200+
domain4.create();
195201

196-
logger.info("Verify no impact on domain4");
197-
domain4.verifyDomainCreated();
202+
logger.info("Verify no impact on domain5");
203+
domain5.verifyDomainCreated();
204+
domain5.destroy();
198205
domain4.destroy();
199-
domain1.destroy();
200206
logger.info("SUCCESS - test5CreateConfiguredDomainInTest2NS");
201207
}
202208

@@ -209,10 +215,10 @@ public void test6CreateDomainWithStartPolicyAdminOnly() throws Exception {
209215
if (operator1 == null) {
210216
operator1 = TestUtils.createOperator(op1YamlFile);
211217
}
212-
logger.info("Creating Domain domain5 & verifing the domain creation");
213-
// create domain5
214-
Domain domain5 = TestUtils.createDomain(domain5YamlFile);
215-
domain5.destroy();
218+
logger.info("Creating Domain domain6 & verifing the domain creation");
219+
// create domain6
220+
Domain domain6 = TestUtils.createDomain(domain6YamlFile);
221+
domain6.destroy();
216222
logger.info("SUCCESS - test6CreateDomainWithStartPolicyAdminOnly");
217223
}
218224

@@ -225,46 +231,45 @@ public void test7CreateDomainPVReclaimPolicyRecycle() throws Exception {
225231
if (operator1 == null) {
226232
operator1 = TestUtils.createOperator(op1YamlFile);
227233
}
228-
logger.info("Creating Domain domain6 & verifing the domain creation");
229-
// create domain6
230-
Domain domain6 = TestUtils.createDomain(domain6YamlFile);
231-
domain6.shutdown();
232-
domain6.deletePVCAndCheckPVReleased();
234+
logger.info("Creating Domain domain7 & verifing the domain creation");
235+
// create domain7
236+
Domain domain7 = TestUtils.createDomain(domain7YamlFile);
237+
domain7.shutdown();
238+
domain7.deletePVCAndCheckPVReleased();
233239
logger.info("SUCCESS - test7CreateDomainPVReclaimPolicyRecycle");
234240
}
235241

236242
@Test
237-
public void test9CreateDomainOnExistingDir() throws Exception {
243+
public void test8CreateDomainOnExistingDir() throws Exception {
238244
Assume.assumeFalse(QUICKTEST);
239245

240-
logTestBegin("test9CreateDomainOnExistingDir");
246+
logTestBegin("test8CreateDomainOnExistingDir");
241247
if (operator1 == null) {
242248
operator1 = TestUtils.createOperator(op1YamlFile);
243249
}
244-
if (domain1 == null) {
245-
domain1 = TestUtils.createDomain(domain1YamlFile);
246-
// create domain on existing dir
247-
domain1.destroy();
248-
}
249-
logger.info("domain1 " + domain1);
250-
domain1.createDomainOnExistingDirectory();
251-
logger.info("SUCCESS - test9CreateDomainOnExistingDir");
250+
251+
Domain domain8 = TestUtils.createDomain(domain8YamlFile);
252+
// create domain on existing dir
253+
domain8.destroy();
254+
255+
domain8.createDomainOnExistingDirectory();
256+
logger.info("SUCCESS - test8CreateDomainOnExistingDir");
252257
}
253258

254259
// @Test
255260
public void testACreateDomainApacheLB() throws Exception {
256261
Assume.assumeFalse(QUICKTEST);
257262

258263
logTestBegin("testACreateDomainApacheLB");
259-
logger.info("Creating Domain domain7 & verifing the domain creation");
264+
logger.info("Creating Domain domain9 & verifing the domain creation");
260265
if (operator1 == null) {
261266
operator1 = TestUtils.createOperator(op1YamlFile);
262267
}
263268

264269
// create domain7
265-
Domain domain7 = TestUtils.createDomain(domain7YamlFile);
266-
domain7.verifyAdminConsoleViaLB();
267-
domain7.destroy();
270+
Domain domain9 = TestUtils.createDomain(domain9YamlFile);
271+
domain9.verifyAdminConsoleViaLB();
272+
domain9.destroy();
268273
logger.info("SUCCESS - testACreateDomainApacheLB");
269274
}
270275

@@ -273,17 +278,59 @@ public void testBCreateDomainWithDefaultValuesInSampleInputs() throws Exception
273278
Assume.assumeFalse(QUICKTEST);
274279

275280
logTestBegin("testBCreateDomainWithDefaultValuesInSampleInputs");
276-
logger.info("Creating Domain domain8 & verifing the domain creation");
281+
logger.info("Creating Domain domain10 & verifing the domain creation");
277282
if (operator1 == null) {
278283
operator1 = TestUtils.createOperator(op1YamlFile);
279284
}
280285

281-
// create domain8
282-
Domain domain8 = testAllUseCasesForADomain(operator1, domain8YamlFile);
283-
domain8.destroy();
286+
// create domain10
287+
Domain domain10 = testAllUseCasesForADomain(operator1, domain10YamlFile);
288+
domain10.destroy();
284289
logger.info("SUCCESS - testBCreateDomainWithDefaultValuesInSampleInputs");
285290
}
286291

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

0 commit comments

Comments
 (0)