@@ -49,7 +49,7 @@ public class ITImagetool extends BaseTest {
49
49
@ BeforeClass
50
50
public static void staticPrepare () throws Exception {
51
51
logger .info ("prepare for image tool test ..." );
52
-
52
+ // initialize
53
53
initialize ();
54
54
// clean up the env first
55
55
cleanup ();
@@ -107,6 +107,7 @@ public void test2CacheAddInstallerJDK() throws Exception {
107
107
logTestBegin (testMethodName );
108
108
109
109
String jdkPath = getInstallerCacheDir () + FS + JDK_INSTALLER ;
110
+ deleteEntryFromCache ("jdk_" + JDK_VERSION );
110
111
addInstallerToCache ("jdk" , JDK_VERSION , jdkPath );
111
112
112
113
ExecResult result = listItemsInCache ();
@@ -126,6 +127,7 @@ public void test3CacheAddInstallerWLS() throws Exception {
126
127
logTestBegin (testMethodName );
127
128
128
129
String wlsPath = getInstallerCacheDir () + FS + WLS_INSTALLER ;
130
+ deleteEntryFromCache ("wls_" + WLS_VERSION );
129
131
addInstallerToCache ("wls" , WLS_VERSION , wlsPath );
130
132
131
133
ExecResult result = listItemsInCache ();
@@ -144,9 +146,12 @@ public void test4CreateWLSImg() throws Exception {
144
146
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
145
147
logTestBegin (testMethodName );
146
148
147
- String command = imagetool + " create --jdkVersion=" + JDK_VERSION + " --tag imagetool:" + testMethodName ;
149
+ String command = imagetool + " create --jdkVersion=" + JDK_VERSION + " --tag " +
150
+ build_tag + ":" + testMethodName ;
148
151
logger .info ("Executing command: " + command );
149
- ExecCommand .exec (command , true );
152
+ ExecResult result = ExecCommand .exec (command );
153
+ logger .info ("DEBUG: result.stdout=" + result .stdout ());
154
+ logger .info ("DEBUG: result.stderr=" + result .stderr ());
150
155
151
156
// verify the docker image is created
152
157
verifyDockerImages (testMethodName );
@@ -227,10 +232,11 @@ public void test8CreateWLSImgUseCache() throws Exception {
227
232
228
233
// need to add the required patches 28186730 for Opatch before create wls images
229
234
String patchPath = getInstallerCacheDir () + FS + P28186730_INSTALLER ;
235
+ deleteEntryFromCache (P28186730_ID + "_opatch" );
230
236
addPatchToCache ("wls" , P28186730_ID , OPATCH_VERSION , patchPath );
231
237
232
238
String command = imagetool + " create --jdkVersion " + JDK_VERSION + " --fromImage " +
233
- BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag imagetool :" + testMethodName +
239
+ BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag " + build_tag + " :" + testMethodName +
234
240
" --version " + WLS_VERSION ;
235
241
logger .info ("Executing command: " + command );
236
242
ExecCommand .exec (command , true );
@@ -250,8 +256,8 @@ public void test9UpdateWLSImg() throws Exception {
250
256
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
251
257
logTestBegin (testMethodName );
252
258
253
- String command = imagetool + " update --fromImage imagetool:test8CreateWLSImgUseCache --tag imagetool: " +
254
- testMethodName + " --patches " + P27342434_ID ;
259
+ String command = imagetool + " update --fromImage imagetool:test8CreateWLSImgUseCache --tag " +
260
+ build_tag + ":" + testMethodName + " --patches " + P27342434_ID ;
255
261
logger .info ("Executing command: " + command );
256
262
ExecCommand .exec (command , true );
257
263
@@ -307,7 +313,7 @@ public void testACreateWLSImgUsingWDT() throws Exception {
307
313
String wdtModel = getWDTResourcePath () + FS + WDT_MODEL ;
308
314
String wdtVariables = getWDTResourcePath () + FS + WDT_VARIABLES ;
309
315
String command = imagetool + " create --fromImage " +
310
- BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag imagetool :" + testMethodName +
316
+ BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag " + build_tag + " :" + testMethodName +
311
317
" --version " + WLS_VERSION + " --patches " + P27342434_ID + " --wdtVersion " + WDT_VERSION +
312
318
" --wdtArchive " + wdtArchive + " --wdtDomainHome /u01/domains/simple_domain --wdtModel " +
313
319
wdtModel + " --wdtVariables " + wdtVariables ;
@@ -343,7 +349,7 @@ public void testBCreateFMWImgFullInternetAccess() throws Exception {
343
349
String jdkPath = getInstallerCacheDir () + FS + JDK_INSTALLER ;
344
350
addInstallerToCache ("jdk" , JDK_VERSION , jdkPath );
345
351
346
- String command = imagetool + " create --version=" + WLS_VERSION + " --tag imagetool :" + testMethodName +
352
+ String command = imagetool + " create --version=" + WLS_VERSION + " --tag " + build_tag + " :" + testMethodName +
347
353
" --latestPSU --user " + oracleSupportUsername + " --passwordEnv ORACLE_SUPPORT_PASSWORD --type fmw" ;
348
354
logger .info ("Executing command: " + command );
349
355
ExecCommand .exec (command , true );
@@ -365,18 +371,21 @@ public void testCCreateFMWImgNonDefault() throws Exception {
365
371
366
372
// add fmw installer to the cache
367
373
String fmwPath = getInstallerCacheDir () + FS + FMW_INSTALLER_1221 ;
374
+ deleteEntryFromCache ("fmw_" + WLS_VERSION_1221 );
368
375
addInstallerToCache ("fmw" , WLS_VERSION_1221 , fmwPath );
369
376
370
377
// add jdk installer to the cache
371
378
String jdkPath = getInstallerCacheDir () + FS + JDK_INSTALLER_8u212 ;
379
+ deleteEntryFromCache ("jdk_" + JDK_VERSION_8u212 );
372
380
addInstallerToCache ("jdk" , JDK_VERSION_8u212 , jdkPath );
373
381
374
382
// add the patch to the cache
375
383
String patchPath = getInstallerCacheDir () + FS + P22987840_INSTALLER ;
384
+ deleteEntryFromCache (P22987840_ID + "_" + WLS_VERSION_1221 );
376
385
addPatchToCache ("fmw" , P22987840_ID , WLS_VERSION_1221 , patchPath );
377
386
378
387
String command = imagetool + " create --jdkVersion " + JDK_VERSION_8u212 + " --version=" + WLS_VERSION_1221 +
379
- " --tag imagetool :" + testMethodName + " --patches " + P22987840_ID + " --type fmw" ;
388
+ " --tag " + build_tag + " :" + testMethodName + " --patches " + P22987840_ID + " --type fmw" ;
380
389
logger .info ("Executing command: " + command );
381
390
ExecCommand .exec (command , true );
382
391
@@ -429,13 +438,13 @@ public void testDCreateJRFDomainImgUsingWDT() throws Exception {
429
438
Path dest = Paths .get (tmpWdtModel );
430
439
Files .copy (source , dest , StandardCopyOption .REPLACE_EXISTING );
431
440
String getDBContainerIP = "docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' " +
432
- DB_CONTAINER_NAME ;
441
+ dbContainerName ;
433
442
String host = ExecCommand .exec (getDBContainerIP ).stdout ().trim ();
434
443
logger .info ("DEBUG: DB_HOST=" + host );
435
444
replaceStringInFile (tmpWdtModel , "%DB_HOST%" , host );
436
445
437
446
String command = imagetool + " create --fromImage " +
438
- BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag imagetool :" + testMethodName +
447
+ BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag " + build_tag + " :" + testMethodName +
439
448
" --version " + WLS_VERSION + " --wdtVersion " + WDT_VERSION +
440
449
" --wdtArchive " + wdtArchive + " --wdtDomainHome /u01/domains/simple_domain --wdtModel " +
441
450
tmpWdtModel + " --wdtDomainType JRF --wdtRunRCU --type fmw" ;
@@ -483,7 +492,7 @@ public void testECreateRestricedJRFDomainImgUsingWDT() throws Exception {
483
492
String wdtModel = getWDTResourcePath () + FS + WDT_MODEL ;
484
493
String wdtVariables = getWDTResourcePath () + FS + WDT_VARIABLES ;
485
494
String command = imagetool + " create --fromImage " +
486
- BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag imagetool :" + testMethodName +
495
+ BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag " + build_tag + " :" + testMethodName +
487
496
" --version " + WLS_VERSION + " --latestPSU --user " + oracleSupportUsername +
488
497
" --password " + oracleSupportPassword + " --wdtVersion " + WDT_VERSION +
489
498
" --wdtArchive " + wdtArchive + " --wdtDomainHome /u01/domains/simple_domain --wdtModel " +
@@ -535,7 +544,7 @@ public void testFCreateWLSImgUsingMultiModels() throws Exception {
535
544
String wdtModel2 = getWDTResourcePath () + FS + WDT_MODEL2 ;
536
545
String wdtVariables = getWDTResourcePath () + FS + WDT_VARIABLES ;
537
546
String command = imagetool + " create --fromImage " +
538
- BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag imagetool :" + testMethodName +
547
+ BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag " + build_tag + " :" + testMethodName +
539
548
" --version " + WLS_VERSION + " --wdtVersion " + WDT_VERSION +
540
549
" --wdtArchive " + wdtArchive + " --wdtDomainHome /u01/domains/simple_domain --wdtModel " +
541
550
wdtModel + "," + wdtModel2 + " --wdtVariables " + wdtVariables ;
0 commit comments