Skip to content

Commit 0611dd6

Browse files
committed
add RestrictedJRF test case
1 parent 77fe5cb commit 0611dd6

File tree

1 file changed

+57
-1
lines changed
  • imagetool/src/test/java/com/oracle/weblogic/imagetool/integration

1 file changed

+57
-1
lines changed

imagetool/src/test/java/com/oracle/weblogic/imagetool/integration/ITImagetool.java

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public void testCCreateFMWImgNonDefault() throws Exception {
390390
/**
391391
* create a JRF domain image using WDT
392392
* You need to have OCR credentials to pull container-registry.oracle.com/database/enterprise:12.2.0.1-slim
393-
* @throws Exception
393+
* @throws Exception - if any error occurs
394394
*/
395395
@Test
396396
public void testDCreateJRFDomainImgUsingWDT() throws Exception {
@@ -448,4 +448,60 @@ public void testDCreateJRFDomainImgUsingWDT() throws Exception {
448448

449449
logTestEnd(testMethodName);
450450
}
451+
452+
/**
453+
* create a RestrictedJRF domain image using WDT
454+
* @throws Exception - if any error occurs
455+
*/
456+
@Test
457+
public void testECreateJRFDomainImgUsingWDT() throws Exception {
458+
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
459+
logTestBegin(testMethodName);
460+
461+
String user = System.getenv("ORACLE_SUPPORT_USERNAME");
462+
String password = System.getenv("ORACLE_SUPPORT_PASSWORD");
463+
if(user == null || password == null) {
464+
throw new Exception("Please set environment variables ORACLE_SUPPORT_USERNAME and ORACLE_SUPPORT_PASSWORD" +
465+
" for Oracle Support credentials to download the patches.");
466+
}
467+
468+
// add WDT installer to the cache
469+
// delete the cache entry if any
470+
deleteEntryFromCache("wdt_" + WDT_VERSION);
471+
String wdtPath = getInstallerCacheDir() + FS + WDT_INSTALLER;
472+
addInstallerToCache("wdt", WDT_VERSION, wdtPath);
473+
474+
// add FMW installer to the cache
475+
// delete the cache entry if any
476+
deleteEntryFromCache("fmw_" + WLS_VERSION);
477+
String fmwPath = getInstallerCacheDir() + FS + FMW_INSTALLER;
478+
addInstallerToCache("fmw", WLS_VERSION, fmwPath);
479+
480+
// add jdk installer to the cache
481+
// delete the cache entry if any
482+
deleteEntryFromCache("jdk_" + JDK_VERSION);
483+
String jdkPath = getInstallerCacheDir() + FS + JDK_INSTALLER;
484+
addInstallerToCache("jdk", JDK_VERSION, jdkPath);
485+
486+
// build the wdt archive
487+
buildWDTArchive();
488+
489+
String wdtArchive = getWDTResourcePath() + FS + WDT_ARCHIVE;
490+
String wdtModel = getWDTResourcePath() + FS + WDT_MODEL;
491+
String wdtVariables = getWDTResourcePath() + FS + WDT_VARIABLES;
492+
String command = imagetool + " create --fromImage " +
493+
BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag imagetool:" + testMethodName +
494+
" --version " + WLS_VERSION + " --latestPSU --user " + user +
495+
" --passwordEnv ORACLE_SUPPORT_PASSWORD " + " --wdtVersion " + WDT_VERSION +
496+
" --wdtArchive " + wdtArchive + " --wdtDomainHome /u01/domains/simple_domain --wdtModel " +
497+
wdtModel + " --wdtDomainType RestrictedJRF --type fmw --wdtVariables " + wdtVariables;
498+
499+
logger.info("Executing command: " + command);
500+
ExecCommand.exec(command, true);
501+
502+
// verify the docker image is created
503+
verifyDockerImages(testMethodName);
504+
505+
logTestEnd(testMethodName);
506+
}
451507
}

0 commit comments

Comments
 (0)