Skip to content

Commit 898b967

Browse files
authored
Mii app patching test (#1616)
* Initial changes to test application update * Add app assertions * Save the current change * Update ItMiiDomain test * More changes * verify an app from a server pod * add code to patch the domain with a new image and verify * Revert unintended changes * Fix merge issues * more cleanup * Initial change for test number 6 * Fix ExecCommand to allow both redirect and saveResults enabled the same time * Initial change for adding another app * More impl for the second test case * Add model file for the second app * Minor cleanup * Clean up comments * Minor fix * Move delete images to the end of AfterAll * Update command to check response * Fix a merge error * Fix exec command * Add code for remote repo stuff for the new tests * Minor fixes * Cleanup * Fix image name * Add an app file * Make sure the thread joins before we save the stdout * Remove ItWitValidation class becuase the test in it has been copied to ItMiiDomain class * Revert "Remove ItWitValidation class becuase the test in it has been copied to ItMiiDomain class" This reverts commit c243b49. * Debugging * Fix pushed image name * Turn off debugging * Testing * Change single check of expected condition to quick retry * Check app on all managed servers * Check each pod to verify if the image has been patched * Fine tuning * clean up * More cleanup * Continue work in progress * Add app continuous availability check and enable it with a system property * Clean up * More javadoc * javadoc and cleanup * Adjust timeout values * Fine tuning * Minor fix * Use kubectl exec command for checking app continuous availability * clean up javadoc * Cleanup * Minor update * Minor update of log messages * More cleanup of log messages and comments * Address review comments * Address one more comment * Minor fix * More logging * Minor comment update * Make log messages more informative * Address a new review comment * Fix a minor merge error * Address more review comments * Update javadoc * Fix merge issues * Update the push image code to check REPO_NAME * remove double adding REMO_NAME * Change baseImageName to image Name * Fix a typo
1 parent f4e9bd2 commit 898b967

29 files changed

+1240
-106
lines changed

new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiConfigMap.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import io.kubernetes.client.openapi.models.V1EnvVar;
1717
import io.kubernetes.client.openapi.models.V1LocalObjectReference;
1818
import io.kubernetes.client.openapi.models.V1ObjectMeta;
19-
import io.kubernetes.client.openapi.models.V1Pod;
2019
import io.kubernetes.client.openapi.models.V1Secret;
2120
import io.kubernetes.client.openapi.models.V1SecretReference;
2221
import io.kubernetes.client.openapi.models.V1ServiceAccount;
@@ -497,21 +496,14 @@ private void checkServiceCreated(String serviceName, String domNamespace) {
497496
}
498497

499498
private void checkServerReadyStatusByExec(String podName, String namespace) {
500-
final V1Pod pod = assertDoesNotThrow(() -> oracle.weblogic.kubernetes.assertions.impl.Kubernetes
501-
.getPod(namespace, null, podName));
502-
503-
if (pod != null) {
504-
ExecResult execResult = assertDoesNotThrow(
505-
() -> execCommand(pod, null, true, READ_STATE_COMMAND));
506-
if (execResult.exitValue() == 0) {
507-
logger.info("execResult: " + execResult);
508-
assertEquals("RUNNING", execResult.stdout(),
509-
"Expected " + podName + ", in namespace " + namespace + ", to be in RUNNING ready status");
510-
} else {
511-
fail("Ready command failed with exit status code: " + execResult.exitValue());
512-
}
499+
ExecResult execResult = assertDoesNotThrow(
500+
() -> execCommand(namespace, podName, null, true, READ_STATE_COMMAND));
501+
if (execResult.exitValue() == 0) {
502+
logger.info("execResult: " + execResult);
503+
assertEquals("RUNNING", execResult.stdout(),
504+
"Expected " + podName + ", in namespace " + namespace + ", to be in RUNNING ready status");
513505
} else {
514-
fail("Did not find pod " + podName + " in namespace " + namespace);
506+
fail("Ready command failed with exit status code: " + execResult.exitValue());
515507
}
516508
}
517509

new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiConfigMapOverride.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import io.kubernetes.client.openapi.models.V1EnvVar;
1919
import io.kubernetes.client.openapi.models.V1LocalObjectReference;
2020
import io.kubernetes.client.openapi.models.V1ObjectMeta;
21-
import io.kubernetes.client.openapi.models.V1Pod;
2221
import io.kubernetes.client.openapi.models.V1Secret;
2322
import io.kubernetes.client.openapi.models.V1SecretReference;
2423
import io.kubernetes.client.openapi.models.V1ServiceAccount;
@@ -566,21 +565,14 @@ private void checkServiceCreated(String serviceName, String domNamespace) {
566565
}
567566

568567
private void checkServerReadyStatusByExec(String podName, String namespace) {
569-
final V1Pod pod = assertDoesNotThrow(() -> oracle.weblogic.kubernetes.assertions.impl.Kubernetes
570-
.getPod(namespace, null, podName));
571-
572-
if (pod != null) {
573-
ExecResult execResult = assertDoesNotThrow(
574-
() -> execCommand(pod, null, true, READ_STATE_COMMAND));
575-
if (execResult.exitValue() == 0) {
576-
logger.info("execResult: " + execResult);
577-
assertEquals("RUNNING", execResult.stdout(),
578-
"Expected " + podName + ", in namespace " + namespace + ", to be in RUNNING ready status");
579-
} else {
580-
fail("Ready command failed with exit status code: " + execResult.exitValue());
581-
}
568+
ExecResult execResult = assertDoesNotThrow(
569+
() -> execCommand(namespace, podName, null, true, READ_STATE_COMMAND));
570+
if (execResult.exitValue() == 0) {
571+
logger.info("execResult: " + execResult);
572+
assertEquals("RUNNING", execResult.stdout(),
573+
"Expected " + podName + ", in namespace " + namespace + ", to be in RUNNING ready status");
582574
} else {
583-
fail("Did not find pod " + podName + " in namespace " + namespace);
575+
fail("Ready command failed with exit status code: " + execResult.exitValue());
584576
}
585577
}
586578

0 commit comments

Comments
 (0)