Skip to content

Commit d52ce9a

Browse files
committed
shutdown domain after test completes successfully
1 parent c12be88 commit d52ce9a

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

integration-tests/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ mvn -Dit.test="ITOperator#test6CreateConfiguredDomainInTest2NS" -DfailIfNoTests=
268268

269269
mvn -Dit.test="ITOperator#test6CreateConfiguredDomainInTest2NS+test7CreateDomainPVReclaimPolicyRecycle" -DfailIfNoTests=false integration-test -P java-integration-tests
270270

271+
# How to run cleanup script
272+
273+
cleanup script deletes the k8s artifacts, local test tmp directory, delete all helm charts and the potentially remote domain pv directories.
274+
cd weblogic-kubernetes-operator
275+
src/integration-tests/bash/cleanup.sh
276+
271277
# Logging/Archiving
272278

273279
Java utils logging is used, writes all the messages to console and java_test_suite.out in $RESULT_ROOT/acceptance_test_tmp directory.

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

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public void test1CreateFirstOperatorAndDomain() throws Exception {
9494
logTestBegin("test1CreateFirstOperatorAndDomain");
9595
testCreateOperatorManagingDefaultAndTest1NS();
9696
domain1 = testAllUseCasesForADomain(operator1, domain1YamlFile);
97+
domain1.testWlsLivenessProbe();
98+
domain1.destroy();
99+
97100
logger.info("SUCCESS - test1CreateFirstOperatorAndDomain");
98101
}
99102

@@ -128,6 +131,7 @@ public void test3CreateDomainInTest1NS() throws Exception {
128131
// create domain3
129132
Domain domain3 = testDomainCreation(domain3YamlFile);
130133
testWLDFScaling(operator1, domain3);
134+
domain3.destroy();
131135
logger.info("SUCCESS - test3CreateDomainInTest1NS");
132136
}
133137

@@ -179,6 +183,7 @@ public void test5CreateConfiguredDomainInTest2NS() throws Exception {
179183

180184
logger.info("Verify no impact on domain4");
181185
domain4.verifyDomainCreated();
186+
domain4.destroy();
182187
logger.info("SUCCESS - test5CreateConfiguredDomainInTest2NS");
183188
}
184189

@@ -194,7 +199,8 @@ public void test6CreateDomainWithStartPolicyAdminOnly() throws Exception {
194199
}
195200
logger.info("Creating Domain domain5 & verifing the domain creation");
196201
// create domain5
197-
TestUtils.createDomain(domain5YamlFile);
202+
Domain domain5 = TestUtils.createDomain(domain5YamlFile);
203+
domain5.destroy();
198204
logger.info("SUCCESS - test6CreateDomainWithStartPolicyAdminOnly");
199205
}
200206

@@ -216,25 +222,6 @@ public void test7CreateDomainPVReclaimPolicyRecycle() throws Exception {
216222
logger.info("SUCCESS - test7CreateDomainPVReclaimPolicyRecycle");
217223
}
218224

219-
@Test
220-
public void test8WlsLivenessProbe() throws Exception {
221-
222-
logTestBegin("test8WlsLivenessProbe");
223-
logger.info("Checking if operator1 is running, if not creating");
224-
if (operator1 == null) {
225-
operator1 = TestUtils.createOperator(op1YamlFile);
226-
}
227-
if (domain1 == null) {
228-
domain1 = TestUtils.createDomain(domain1YamlFile);
229-
}
230-
// test managed server1 pod auto restart
231-
String domain = domain1.getDomainUid();
232-
String namespace = domain1.getDomainMap().get("namespace").toString();
233-
String serverName = domain1.getDomainMap().get("managedServerNameBase").toString() + "1";
234-
TestUtils.testWlsLivenessProbe(domain, serverName, namespace);
235-
logger.info("SUCCESS - test8WlsLivenessProbe");
236-
}
237-
238225
@Test
239226
public void test9CreateDomainOnExistingDir() throws Exception {
240227
Assume.assumeFalse(
@@ -249,7 +236,7 @@ public void test9CreateDomainOnExistingDir() throws Exception {
249236
}
250237
logger.info("domain1 " + domain1);
251238
// create domain on existing dir
252-
domain1.destroy();
239+
// domain1.destroy();
253240
domain1.createDomainOnExistingDirectory();
254241
logger.info("SUCCESS - test9CreateDomainOnExistingDir");
255242
}
@@ -267,6 +254,7 @@ public void testACreateDomainApacheLB() throws Exception {
267254
// create domain7
268255
Domain domain7 = TestUtils.createDomain(domain7YamlFile);
269256
domain7.verifyAdminConsoleViaLB();
257+
domain7.destroy();
270258
logger.info("SUCCESS - testACreateDomainApacheLB");
271259
}
272260

@@ -281,7 +269,8 @@ public void testBCreateDomainWithDefaultValuesInSampleInputs() throws Exception
281269
}
282270

283271
// create domain8
284-
testAllUseCasesForADomain(operator1, domain8YamlFile);
272+
Domain domain8 = testAllUseCasesForADomain(operator1, domain8YamlFile);
273+
domain8.destroy();
285274
logger.info("SUCCESS - testBCreateDomainWithDefaultValuesInSampleInputs");
286275
}
287276

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,13 @@ public String getDomainUid() {
510510
return domainUid;
511511
}
512512

513+
public void testWlsLivenessProbe() throws Exception {
514+
515+
// test managed server1 pod auto restart
516+
String serverName = managedServerNameBase + "1";
517+
TestUtils.testWlsLivenessProbe(domainUid, serverName, domainNS);
518+
}
519+
513520
private int getAdminSericeLBNodePort() throws Exception {
514521

515522
String adminServerLBNodePortService = domainUid + "-apache-webtier";

0 commit comments

Comments
 (0)