Skip to content

Commit 43b47e4

Browse files
committed
fix all the tests to use new verifyPod method
1 parent da0c0f0 commit 43b47e4

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

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

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public void testAdminServerRestartVersion() throws Exception {
342342
Charset charset = StandardCharsets.UTF_8;
343343
Files.write(path, modYaml.getBytes(charset));
344344

345-
// Apply the new yaml to update the domain crd
345+
// Apply the new yaml to update the domain
346346
logger.log(Level.INFO, "kubectl apply -f {0}", path.toString());
347347
ExecResult exec = TestUtils.exec("kubectl apply -f " + path.toString());
348348
logger.info(exec.stdout());
@@ -362,11 +362,13 @@ public void testAdminServerRestartVersion() throws Exception {
362362
logger.log(Level.INFO, "SUCCESS - {0}", testMethodName);
363363
}
364364

365-
// @Test
365+
@Test
366366
public void testClusterRestartVersion() throws Exception {
367367
Assume.assumeFalse(QUICKTEST);
368368
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
369369
logTestBegin(testMethodName);
370+
String podName = domainUid + "-managed-server1";
371+
370372
try {
371373
// Modify the original domain yaml to include restartVersion in admin server node
372374
DomainCRD crd = new DomainCRD(originalYaml);
@@ -387,22 +389,26 @@ public void testClusterRestartVersion() throws Exception {
387389
ExecResult exec = TestUtils.exec("kubectl apply -f " + path.toString());
388390
logger.info(exec.stdout());
389391
logger.info("Verifying if the cluster is restarted");
390-
// Pending
392+
verifyPodStatus(podName, "Terminating");
393+
verifyPodStatus(podName, "Running");
391394
} finally {
392395
logger.log(
393396
Level.INFO, "Reverting back the domain to old crd\n kubectl apply -f {0}", originalYaml);
394397
TestUtils.exec("kubectl apply -f " + originalYaml);
395398
logger.info("Verifying if the cluster is restarted");
396-
// Pending
399+
verifyPodStatus(podName, "Terminating");
400+
verifyPodStatus(podName, "Running");
397401
}
398402
logger.log(Level.INFO, "SUCCESS - {0}", testMethodName);
399403
}
400404

401-
// @Test
405+
@Test
402406
public void testMSRestartVersion() throws Exception {
403407
Assume.assumeFalse(QUICKTEST);
404408
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
405409
logTestBegin(testMethodName);
410+
String podName = domainUid + "-managed-server1";
411+
406412
try {
407413
// Modify the original domain yaml to include restartVersion in admin server node
408414
DomainCRD crd = new DomainCRD(originalYaml);
@@ -425,22 +431,27 @@ public void testMSRestartVersion() throws Exception {
425431
ExecResult exec = TestUtils.exec("kubectl apply -f " + path.toString());
426432
logger.info(exec.stdout());
427433
logger.info("Verifying if the managed server is restarted");
428-
// Pending
434+
verifyPodStatus(podName, "Terminating");
435+
verifyPodStatus(podName, "Running");
429436
} finally {
430437
logger.log(
431438
Level.INFO, "Reverting back the domain to old crd\n kubectl apply -f {0}", originalYaml);
432439
TestUtils.exec("kubectl apply -f " + originalYaml);
433440
logger.info("Verifying if the managed server is restarted");
434-
// Pending
441+
verifyPodStatus(podName, "Terminating");
442+
verifyPodStatus(podName, "Running");
435443
}
436444
logger.log(Level.INFO, "SUCCESS - {0}", testMethodName);
437445
}
438446

439-
// @Test
447+
@Test
440448
public void testDomainRestartVersion() throws Exception {
441449
Assume.assumeFalse(QUICKTEST);
442450
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
443451
logTestBegin(testMethodName);
452+
String adminPod = domainUid + "-" + domain.getAdminServerName();
453+
String msPod = domainUid + "-managed-server1";
454+
444455
try {
445456
// Modify the original domain yaml to include restartVersion in admin server node
446457
DomainCRD crd = new DomainCRD(originalYaml);
@@ -461,13 +472,23 @@ public void testDomainRestartVersion() throws Exception {
461472
ExecResult exec = TestUtils.exec("kubectl apply -f " + path.toString());
462473
logger.info(exec.stdout());
463474
logger.info("Verifying if the domain is restarted");
464-
// Pending
475+
logger.info("Verifying if the admin server is restarted");
476+
verifyPodStatus(adminPod, "Terminating");
477+
verifyPodStatus(adminPod, "Running");
478+
logger.info("Verifying if the managed server is restarted");
479+
verifyPodStatus(msPod, "Terminating");
480+
verifyPodStatus(msPod, "Running");
465481
} finally {
466482
logger.log(
467483
Level.INFO, "Reverting back the domain to old crd\n kubectl apply -f {0}", originalYaml);
468484
TestUtils.exec("kubectl apply -f " + originalYaml);
469485
logger.info("Verifying if the domain is restarted");
470-
// Pending
486+
logger.info("Verifying if the admin server is restarted");
487+
verifyPodStatus(adminPod, "Terminating");
488+
verifyPodStatus(adminPod, "Running");
489+
logger.info("Verifying if the managed server is restarted");
490+
verifyPodStatus(msPod, "Terminating");
491+
verifyPodStatus(msPod, "Running");
471492
}
472493
logger.log(Level.INFO, "SUCCESS - {0}", testMethodName);
473494
}

0 commit comments

Comments
 (0)