Skip to content

Commit 7db2126

Browse files
Attempt to clean up use of bad exec() (#1605)
* add some debugging * fix checkstyle errors * fix logging test * Attempt to clean up use of bad exec() This commit attempts to resolve a number of test failures that occur due to the bad use of the TestUtils.exec() method. This method throws a RuntimeException if the return code of the executed command is non-zero. This method is being used in many places (over 40). Many of those do not appear to need or want that behavior, and should instead be using the ExecCommand.exec() method which executes a command and then returns the result, without throwing an exception if the command fails. In this commit, I have done a visual inspection of each use of TestUtils.exec() and changed them to ExecCommand.exec() where it appeared to make sense. This includes every case where the call was using the return value from the method, and those where it appears clear from the subsequent logic that a failed command was not expected to terminate the process. There were some calls that I left because I could not be sure of the intent, and these will require more study. In order to make the code clearer, and make people think twice about using TestUtils.exec(), which has caused so many failures, I renamed that method to TestUtils.execOrAbortProcess(). Hopefully that will make it clearer that that method has a dangerous and unexpected side effect. Co-authored-by: Ryan Eberhard <[email protected]>
1 parent 2f27ba1 commit 7db2126

29 files changed

+151
-150
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ protected void createResultAndPvDirs(String testClassName) throws Exception {
274274
// for manual/local run, create file handler, create PVROOT
275275
if (!SHARED_CLUSTER) {
276276
LoggerHelper.getLocal().log(Level.INFO, "Creating PVROOT " + pvRoot);
277-
TestUtils.exec("/usr/local/packages/aime/ias/run_as_root \"mkdir -m777 -p "
277+
TestUtils.execOrAbortProcess("/usr/local/packages/aime/ias/run_as_root \"mkdir -m777 -p "
278278
+ pvRoot + "\"", true);
279279
}
280280

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void prepare() throws Exception {
104104
.append("/")
105105
.append(elasticStackYamlLoc);
106106
LoggerHelper.getLocal().log(Level.INFO, "Command to Install Elastic Stack: " + cmd.toString());
107-
TestUtils.exec(cmd.toString());
107+
TestUtils.execOrAbortProcess(cmd.toString());
108108

109109
LoggerHelper.getLocal().log(Level.INFO, "Creating Operator & waiting for the script to complete execution");
110110
Map<String, Object> operatorMap = createOperatorMap(
@@ -188,7 +188,7 @@ public static void staticUnPrepare() throws Exception {
188188
.append("/")
189189
.append(elasticStackYamlLoc);
190190
LoggerHelper.getLocal().log(Level.INFO, "Command to uninstall Elastic Stack: " + cmd.toString());
191-
TestUtils.exec(cmd.toString());
191+
TestUtils.execOrAbortProcess(cmd.toString());
192192

193193
// Restore the test env
194194
Files.delete(new File(loggingYamlFileLoc + "/" + loggingYamlFile).toPath());
@@ -545,7 +545,7 @@ private void downloadWlsLoggingExporterJars() throws Exception {
545545
// Make sure downloading completed
546546
while (i < BaseTest.getMaxIterationsPod()) {
547547
try {
548-
ExecResult result = TestUtils.exec(getJars.toString());
548+
ExecResult result = TestUtils.execOrAbortProcess(getJars.toString());
549549
LoggerHelper.getLocal().log(Level.INFO,"exit code: " + result.exitValue());
550550
LoggerHelper.getLocal().log(Level.INFO,"Result: " + result.stdout());
551551
} catch (RuntimeException rtect) {
@@ -583,7 +583,7 @@ private void downloadWlsLoggingExporterJars() throws Exception {
583583
// Make sure downloading completed
584584
while (i < BaseTest.getMaxIterationsPod()) {
585585
try {
586-
ExecResult result = TestUtils.exec(getJars.toString());
586+
ExecResult result = TestUtils.execOrAbortProcess(getJars.toString());
587587
LoggerHelper.getLocal().log(Level.INFO, "exit code: " + result.exitValue());
588588
LoggerHelper.getLocal().log(Level.INFO, "Result: " + result.stdout());
589589
} catch (RuntimeException rtect) {
@@ -665,7 +665,7 @@ private void copyResourceFilesToOnePod(String podName, String domainNS)
665665
.append("'");
666666
LoggerHelper.getLocal().log(Level.INFO, "Executing cmd " + cmdLisDir.toString());
667667

668-
ExecResult result = TestUtils.exec(cmdLisDir.toString());
668+
ExecResult result = TestUtils.execOrAbortProcess(cmdLisDir.toString());
669669
LoggerHelper.getLocal().log(Level.INFO, "exit code: " + result.exitValue());
670670
LoggerHelper.getLocal().log(Level.INFO, "Result: " + result.stdout());
671671

@@ -679,14 +679,14 @@ private void copyResourceFilesToOnePod(String podName, String domainNS)
679679
.append(domainUid)
680680
.append("/lib/'");
681681
LoggerHelper.getLocal().log(Level.INFO, "Executing cmd " + cmdLisDir.toString());
682-
result = TestUtils.exec(cmdLisDir.toString());
682+
result = TestUtils.execOrAbortProcess(cmdLisDir.toString());
683683
LoggerHelper.getLocal().log(Level.INFO, "exit code: " + result.exitValue());
684684
LoggerHelper.getLocal().log(Level.INFO, "Result: " + result.stdout());
685685

686686
cmdLisDir.setLength(0);
687687
cmdLisDir = new StringBuffer("ls -l " + loggingExpArchiveLoc);
688688
LoggerHelper.getLocal().log(Level.INFO, "Executing cmd " + cmdLisDir.toString());
689-
result = TestUtils.exec(cmdLisDir.toString());
689+
result = TestUtils.execOrAbortProcess(cmdLisDir.toString());
690690
LoggerHelper.getLocal().log(Level.INFO, "exit code: " + result.exitValue());
691691
LoggerHelper.getLocal().log(Level.INFO, "Result: " + result.stdout());
692692

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public void testCustomImageUsed() throws Exception {
202202
LoggerHelper.getLocal().log(Level.INFO, "Command to get pod's image name: " + cmd);
203203

204204
try {
205-
result = TestUtils.exec(cmd);
205+
result = TestUtils.execOrAbortProcess(cmd);
206206

207207
Assumptions.assumeTrue((result.stdout()).equals(weblogicImageTagWIT),
208208
"Failed to use the image <" + weblogicImageTagWIT + "> built by imagetool");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ private void testInitContainer(String modYaml) throws Exception {
392392

393393
// Apply the new yaml to update the domain
394394
LoggerHelper.getLocal().log(Level.INFO, "kubectl apply -f {0}", path.toString());
395-
ExecResult exec = TestUtils.exec("kubectl apply -f " + path.toString());
395+
ExecResult exec = TestUtils.execOrAbortProcess("kubectl apply -f " + path.toString());
396396
LoggerHelper.getLocal().log(Level.INFO, exec.stdout());
397397
}
398398

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void prepare() throws Exception {
5959
if (QUICKTEST) {
6060
createResultAndPvDirs(testClassName);
6161

62-
TestUtils.exec(
62+
TestUtils.execOrAbortProcess(
6363
"cp -rf "
6464
+ BaseTest.getProjectRoot()
6565
+ "/kubernetes/samples/scripts "

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ private ExecResult addDataToCache(String firstName, String secondName) throws Ex
330330
.append(appToDeploy);
331331

332332
LoggerHelper.getLocal().log(Level.INFO, "curlCmd is " + curlCmd.toString());
333-
ExecResult result = TestUtils.exec(curlCmd.toString(), true);
333+
ExecResult result = ExecCommand.exec(curlCmd.toString());
334334

335335
return result;
336336
}
@@ -352,7 +352,7 @@ private ExecResult getCacheSize() throws Exception {
352352
.append(appToDeploy)
353353
.append("/")
354354
.append(appToDeploy);
355-
ExecResult result = TestUtils.exec(curlCmd.toString(), true);
355+
ExecResult result = ExecCommand.exec(curlCmd.toString());
356356
return result;
357357
}
358358

@@ -373,7 +373,7 @@ private ExecResult getCacheContents() throws Exception {
373373
.append(appToDeploy)
374374
.append("/")
375375
.append(appToDeploy);
376-
ExecResult result = TestUtils.exec(curlCmd.toString(), true);
376+
ExecResult result = ExecCommand.exec(curlCmd.toString());
377377
return result;
378378
}
379379

@@ -394,7 +394,7 @@ private ExecResult clearCache() throws Exception {
394394
.append(appToDeploy)
395395
.append("/")
396396
.append(appToDeploy);
397-
ExecResult result = TestUtils.exec(curlCmd.toString(), true);
397+
ExecResult result = ExecCommand.exec(curlCmd.toString());
398398
return result;
399399
}
400400
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ public void testCredentialsChange() throws Exception {
226226

227227
// Apply the new yaml to update the domain crd
228228
LoggerHelper.getLocal().log(Level.INFO, "kubectl apply -f {0}", path.toString());
229-
ExecResult exec = TestUtils.exec("kubectl apply -f " + path.toString());
229+
ExecResult exec = TestUtils.execOrAbortProcess("kubectl apply -f " + path.toString());
230230
LoggerHelper.getLocal().log(Level.INFO, exec.stdout());
231231
LoggerHelper.getLocal().log(Level.INFO, "Verifying if the domain is restarted");
232232
domain.verifyAdminServerRestarted();

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.util.logging.Level;
1414

1515
import oracle.kubernetes.operator.utils.Domain;
16+
import oracle.kubernetes.operator.utils.ExecCommand;
1617
import oracle.kubernetes.operator.utils.ExecResult;
1718
import oracle.kubernetes.operator.utils.LoggerHelper;
1819
import oracle.kubernetes.operator.utils.Operator;
@@ -597,7 +598,7 @@ private String getJndiName(Domain domain) {
597598

598599
try {
599600
LoggerHelper.getLocal().log(Level.INFO, "Command to exec: " + cmdStrBuff);
600-
result = TestUtils.exec(cmdStrBuff.toString());
601+
result = TestUtils.execOrAbortProcess(cmdStrBuff.toString());
601602
LoggerHelper.getLocal().log(Level.INFO, "JDBC DS info from server pod: " + result.stdout());
602603
jdbcDsStr = result.stdout();
603604
} catch (Exception ex) {
@@ -647,7 +648,7 @@ private String getJdbcResources(String destDir, Domain domain) {
647648
.append(domainNS)
648649
.append(" -o=jsonpath='{.items[0].metadata.name}' | grep admin-server");
649650
LoggerHelper.getLocal().log(Level.INFO, "Command to get pod name: " + cmdStrBuff);
650-
result = TestUtils.exec(cmdStrBuff.toString());
651+
result = TestUtils.execOrAbortProcess(cmdStrBuff.toString());
651652
String adminPodName = result.stdout();
652653
LoggerHelper.getLocal().log(Level.INFO, "pod name is: " + adminPodName);
653654

@@ -661,7 +662,7 @@ private String getJdbcResources(String destDir, Domain domain) {
661662
.append(BaseTest.getAppLocationInPod())
662663
.append("'");
663664
LoggerHelper.getLocal().log(Level.INFO, "Command to exec: " + cmdStrBuff);
664-
TestUtils.exec(cmdStrBuff.toString(), true);
665+
TestUtils.execOrAbortProcess(cmdStrBuff.toString(), true);
665666

666667
TestUtils.copyFileViaCat(
667668
Paths.get(tempDir, pyFileName).toString(),
@@ -680,7 +681,7 @@ private String getJdbcResources(String destDir, Domain domain) {
680681
.append(pyFileName)
681682
.append("'");
682683
LoggerHelper.getLocal().log(Level.INFO, "Command to exec: " + cmdStrBuff);
683-
result = TestUtils.exec(cmdStrBuff.toString(), true);
684+
result = ExecCommand.exec(cmdStrBuff.toString());
684685
jdbcDsStr = result.stdout();
685686
//clean up
686687
LoggerHelper.getLocal().log(Level.INFO, "Deleting: " + destDir + "/" + pyFileName);
@@ -734,7 +735,7 @@ private String verifyApp() throws Exception {
734735
.append("kubectl get pod -n ")
735736
.append(domainNS)
736737
.append(" -o=jsonpath='{.items[1].metadata.name}' | grep managed-server1");
737-
String msPodName = TestUtils.exec(cmdStrBuff.toString()).stdout();
738+
String msPodName = TestUtils.execOrAbortProcess(cmdStrBuff.toString()).stdout();
738739

739740
// access the application deployed in managed-server1
740741
cmdStrBuff = new StringBuffer();
@@ -748,7 +749,7 @@ private String verifyApp() throws Exception {
748749
.append("'");
749750

750751
try {
751-
ExecResult exec = TestUtils.exec(cmdStrBuff.toString(), true);
752+
ExecResult exec = ExecCommand.exec(cmdStrBuff.toString());
752753
appStr = exec.stdout();
753754
} catch (Exception ex) {
754755
LoggerHelper.getLocal().log(Level.INFO, "Varify app failed:\n " + ex.getMessage());

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ public static void staticUnPrepare() throws Exception {
190190
+ domainNS2
191191
+ "-image:" + currentDateTime;
192192
String cmd = "docker rmi -f " + image;
193-
TestUtils.exec(cmd, true);
193+
TestUtils.execOrAbortProcess(cmd, true);
194194
}
195195
String cmd = "docker rmi -f " + domainNS2 + "-image:" + currentDateTime;
196-
TestUtils.exec(cmd, true);
196+
TestUtils.execOrAbortProcess(cmd, true);
197197
}
198198
if (operator != null) {
199199
operator.destroy();
@@ -248,7 +248,7 @@ private static void executeShelScript(String srcLoc, String destLoc, String file
248248
Files.createDirectories(Paths.get(destLoc));
249249
}
250250
String crdCmd = " cp " + srcLoc + "/" + fileName + " " + destLoc;
251-
TestUtils.exec(crdCmd, true);
251+
TestUtils.execOrAbortProcess(crdCmd, true);
252252
crdCmd =
253253
"cd "
254254
+ destLoc
@@ -260,7 +260,7 @@ private static void executeShelScript(String srcLoc, String destLoc, String file
260260
+ args
261261
+ " | tee "
262262
+ outLogFile;
263-
TestUtils.exec(crdCmd, true);
263+
TestUtils.execOrAbortProcess(crdCmd, true);
264264
crdCmd = " cat " + destLoc + "/" + outLogFile;
265265
ExecResult result = ExecCommand.exec(crdCmd);
266266
assertFalse(
@@ -385,7 +385,7 @@ private void upgradeTraefikHostName() throws Exception {
385385
cmd.append(" -n " + domainNS1);
386386

387387
LoggerHelper.getLocal().log(Level.INFO, " upgradeTraefikNamespace() Running " + cmd.toString());
388-
TestUtils.exec(cmd.toString());
388+
TestUtils.execOrAbortProcess(cmd.toString());
389389
}
390390

391391
/**
@@ -860,7 +860,7 @@ private void fireAlert() throws Exception {
860860
// apply new domain yaml and verify pod restart
861861
String crdCmd =
862862
" kubectl apply -f " + monitoringExporterEndToEndDir + "/demo-domains/domainInImage.yaml";
863-
TestUtils.exec(crdCmd);
863+
TestUtils.execOrAbortProcess(crdCmd);
864864

865865
TestUtils.checkPodReady(domainNS2 + "-admin-server", domainNS2);
866866
TestUtils.checkPodReady(domainNS2 + "-managed-server-1", domainNS2);
@@ -889,7 +889,7 @@ private static void configureDomainInPrometheus(String oldDomainNS,
889889
" kubectl -n " + monitoringNS + " get cm prometheus-server -oyaml > "
890890
+ monitoringExporterEndToEndDir
891891
+ "/cm.yaml";
892-
TestUtils.exec(crdCmd);
892+
TestUtils.execOrAbortProcess(crdCmd);
893893
ExecResult result = ExecCommand.exec("cat " + monitoringExporterEndToEndDir + "/cm.yaml");
894894
LoggerHelper.getLocal().log(Level.INFO, " output for cm " + result.stdout());
895895
replaceStringInFile(
@@ -900,7 +900,7 @@ private static void configureDomainInPrometheus(String oldDomainNS,
900900
+ " apply -f "
901901
+ monitoringExporterEndToEndDir
902902
+ "/cm.yaml";
903-
TestUtils.exec(crdCmd);
903+
TestUtils.execOrAbortProcess(crdCmd);
904904
}
905905

906906
private static String getPodName(String labelExp, String namespace) throws Exception {
@@ -1095,12 +1095,12 @@ private static void createWlsImageAndDeploy() throws Exception {
10951095
+ wlsUser
10961096
+ " --from-literal=password="
10971097
+ wlsPassword;
1098-
TestUtils.exec(crdCmd);
1098+
TestUtils.execOrAbortProcess(crdCmd);
10991099

11001100
// apply new domain yaml and verify pod restart
11011101
crdCmd =
11021102
" kubectl apply -f " + monitoringExporterEndToEndDir + "/demo-domains/domainInImage.yaml";
1103-
TestUtils.exec(crdCmd);
1103+
TestUtils.execOrAbortProcess(crdCmd);
11041104

11051105
TestUtils.checkPodReady(domainNS2 + "-admin-server", domainNS2);
11061106
TestUtils.checkPodReady(domainNS2 + "-managed-server-1", domainNS2);
@@ -1109,7 +1109,7 @@ private static void createWlsImageAndDeploy() throws Exception {
11091109
replaceStringInFile(monitoringExporterEndToEndDir + "/util/curl.yaml", "default", domainNS2);
11101110
// apply curl to the pod
11111111
crdCmd = " kubectl apply -f " + monitoringExporterEndToEndDir + "/util/curl.yaml";
1112-
TestUtils.exec(crdCmd);
1112+
TestUtils.execOrAbortProcess(crdCmd);
11131113

11141114
TestUtils.checkPodReady("curl", domainNS2);
11151115
// access metrics
@@ -1119,15 +1119,15 @@ private static void createWlsImageAndDeploy() throws Exception {
11191119
+ ":"
11201120
+ wlsPassword
11211121
+ "@" + domainNS2 + "-managed-server-1:8001/wls-exporter/metrics";
1122-
ExecResult result = TestUtils.exec(crdCmd);
1122+
ExecResult result = TestUtils.execOrAbortProcess(crdCmd);
11231123
assertTrue((result.stdout().contains("wls_servlet_execution_time_average")));
11241124
crdCmd =
11251125
"kubectl exec -n " + domainNS2 + " curl -- curl http://"
11261126
+ wlsUser
11271127
+ ":"
11281128
+ wlsPassword
11291129
+ "@" + domainNS2 + "-managed-server-2:8001/wls-exporter/metrics";
1130-
result = TestUtils.exec(crdCmd);
1130+
result = TestUtils.execOrAbortProcess(crdCmd);
11311131
assertTrue((result.stdout().contains("wls_servlet_execution_time_average")));
11321132
}
11331133

@@ -1143,7 +1143,7 @@ private static ExecResult loginAndTagImage(String oldImageName, String newImageN
11431143
+ oldImageName
11441144
+ " "
11451145
+ newImageName;
1146-
ExecResult result = TestUtils.exec(dockerLoginAndTagCmd);
1146+
ExecResult result = TestUtils.execOrAbortProcess(dockerLoginAndTagCmd);
11471147
LoggerHelper.getLocal().log(Level.INFO,
11481148
"cmd "
11491149
+ dockerLoginAndTagCmd
@@ -1164,7 +1164,7 @@ private static void installPrometheusGrafanaWebHookMySqlCoordinator() throws Exc
11641164
String crdCmd = " cp " + resourceExporterDir + "/promvalues.yaml"
11651165
+ " " + monitoringExporterEndToEndDir
11661166
+ "/prometheus/promvalues.yaml";
1167-
TestUtils.exec(crdCmd, true);
1167+
TestUtils.execOrAbortProcess(crdCmd, true);
11681168
String promalertmanagerPort = String.valueOf(32500 + getNewSuffixCount());
11691169
replaceStringInFile(
11701170
monitoringExporterEndToEndDir + "/prometheus/promvalues.yaml", "32500", promalertmanagerPort);
@@ -1223,15 +1223,15 @@ static void checkPromGrafana(String searchKey, String expectedVal) throws Except
12231223
+ " && curl -v -H 'Content-Type: application/json' -H \"Content-Type: application/json\""
12241224
+ " -X POST http://admin:12345678@" + myhost + ":" + grafanaPort + "/api/datasources/"
12251225
+ " --data-binary @grafana/datasource.json";
1226-
TestUtils.exec(crdCmd);
1226+
TestUtils.execOrAbortProcess(crdCmd);
12271227

12281228
crdCmd =
12291229
" cd "
12301230
+ monitoringExporterEndToEndDir
12311231
+ " && curl -v -H 'Content-Type: application/json' -H \"Content-Type: application/json\""
12321232
+ " -X POST http://admin:12345678@" + myhost + ":" + grafanaPort + "/api/dashboards/db/"
12331233
+ " --data-binary @grafana/dashboard.json";
1234-
TestUtils.exec(crdCmd);
1234+
TestUtils.execOrAbortProcess(crdCmd);
12351235
crdCmd = " cd "
12361236
+ monitoringExporterEndToEndDir
12371237
+ " && "
@@ -1310,7 +1310,7 @@ private static void deletePvDir() throws Exception {
13101310
if (new File(pvDir).exists()) {
13111311

13121312
LoggerHelper.getLocal().log(Level.INFO, "Deleting pv created dir " + pvDir);
1313-
TestUtils.exec("/usr/local/packages/aime/ias/run_as_root \"rm -rf " + pvDir + "\"");
1313+
TestUtils.execOrAbortProcess("/usr/local/packages/aime/ias/run_as_root \"rm -rf " + pvDir + "\"");
13141314
}
13151315
}
13161316
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ public void cleanupOperatorAndDomain() throws Exception {
105105
if (operator != null) {
106106
operator.destroy();
107107
}
108-
TestUtils.exec("rm -rf " + Paths.get(opUpgradeTmpDir).toString());
109-
TestUtils.exec("kubectl delete crd domains.weblogic.oracle --ignore-not-found");
108+
TestUtils.execOrAbortProcess("rm -rf " + Paths.get(opUpgradeTmpDir).toString());
109+
TestUtils.execOrAbortProcess("kubectl delete crd domains.weblogic.oracle --ignore-not-found");
110110
// Make sure domain CRD is deleted form k8s
111111
ExecResult result = ExecCommand.exec("kubectl get crd domains.weblogic.oracle",true);
112112
Assertions.assertEquals(1, result.exitValue());
@@ -171,8 +171,8 @@ private void checkCrdVersion() throws Exception {
171171
+ getCrdVersion()
172172
+ " in a loop ");
173173
for (int i = 0; i < BaseTest.getMaxIterationsPod(); i++) {
174-
exec = TestUtils.exec(
175-
"kubectl get crd domains.weblogic.oracle -o jsonpath='{.spec.versions[?(@.storage==true)].name}'", true);
174+
exec = ExecCommand.exec(
175+
"kubectl get crd domains.weblogic.oracle -o jsonpath='{.spec.versions[?(@.storage==true)].name}'");
176176
if (exec.stdout().contains(getCrdVersion())) {
177177
LoggerHelper.getLocal().log(Level.INFO, "Got Expected CRD Version");
178178
result = true;
@@ -223,7 +223,7 @@ private void setupOperatorAndDomain(String operatorGitRelease, String operatorRe
223223
throws Exception {
224224
LoggerHelper.getLocal().log(Level.INFO, "+++++++++++++++Beginning Test Setup+++++++++++++++++++++");
225225
opUpgradeTmpDir = getResultDir() + "/operatorupgrade";
226-
TestUtils.exec("rm -rf " + Paths.get(opUpgradeTmpDir).toString());
226+
TestUtils.execOrAbortProcess("rm -rf " + Paths.get(opUpgradeTmpDir).toString());
227227
Files.createDirectories(Paths.get(opUpgradeTmpDir));
228228
Map<String, Object> operatorMap = createOperatorMap(getNewSuffixCount(), true, "");
229229
operatorMap.put("operatorImageName", "oracle/weblogic-kubernetes-operator");

0 commit comments

Comments
 (0)