Skip to content

Commit 431b9f6

Browse files
committed
use krun.sh to check dir exists
1 parent 57ebe98 commit 431b9f6

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import java.util.Map;
88
import oracle.kubernetes.operator.utils.Domain;
9-
import oracle.kubernetes.operator.utils.ExecResult;
109
import oracle.kubernetes.operator.utils.Operator;
1110
import oracle.kubernetes.operator.utils.Operator.RESTCertType;
1211
import oracle.kubernetes.operator.utils.TestUtils;
@@ -254,20 +253,10 @@ public void testCreateDomainWithStartPolicyAdminOnly() throws Exception {
254253
domain = TestUtils.createDomain(DOMAIN_ADMINONLY_YAML);
255254
domain.verifyDomainCreated();
256255
} finally {
257-
Map<String, Object> domainMap = domain.getDomainMap();
258-
String domainStoragePath = domainMap.get("weblogicDomainStoragePath").toString();
259-
String domainDir = domainStoragePath + "/domains/" + domainMap.get("domainUID").toString();
260-
ExecResult result =
261-
TestUtils.exec("ls -ltr " + domainDir + " && ls -ltr " + domainStoragePath + "/domains/");
262-
logger.info("ls -ltr " + result.stdout() + " err " + result.stderr());
263-
264256
if (domain != null) {
265257
// create domain on existing dir
266258
domain.destroy();
267259
}
268-
result =
269-
TestUtils.exec("ls -ltr " + domainDir + " && ls -ltr " + domainStoragePath + "/domains/");
270-
logger.info("ls -ltr " + result.stdout() + " err " + result.stderr());
271260
}
272261

273262
domain.createDomainOnExistingDirectory();

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,14 +638,18 @@ public void deletePVCAndCheckPVReleased() throws Exception {
638638
public void createDomainOnExistingDirectory() throws Exception {
639639
String domainStoragePath = domainMap.get("weblogicDomainStoragePath").toString();
640640
String domainDir = domainStoragePath + "/domains/" + domainMap.get("domainUID").toString();
641-
logger.info("making sure the domain directory exists");
642-
ExecResult result =
643-
TestUtils.exec("ls -ltr " + domainDir + " && ls -ltr " + domainStoragePath + "/domains/");
644-
logger.info("ls -ltr " + result.stdout() + " err " + result.stderr());
645-
if (domainDir != null && !(new File(domainDir).exists())) {
641+
String cmd =
642+
BaseTest.getProjectRoot()
643+
+ "/src/integration-tests/bash/krun.sh -c \"ls -ltr "
644+
+ domainDir
645+
+ "\"";
646+
logger.info("making sure the domain directory exists by running " + cmd);
647+
ExecResult result = TestUtils.exec(cmd);
648+
logger.info("Command result " + result.stdout() + " err =" + result.stderr());
649+
/* if (domainDir != null && !(new File(domainDir).exists())) {
646650
throw new RuntimeException(
647651
"FAIL: the domain directory " + domainDir + " does not exist, exiting!");
648-
}
652+
} */
649653
logger.info("Run the script to create domain");
650654

651655
// create domain using different output dir but pv is same, it fails as the domain was already

0 commit comments

Comments
 (0)