17
17
public class ITImagetool extends BaseTest {
18
18
19
19
private static final String JDK_INSTALLER = "jdk-8u202-linux-x64.tar.gz" ;
20
+ private static final String JDK_INSTALLER_8u212 = "jdk-8u212-linux-x64.tar.gz" ;
20
21
private static final String WLS_INSTALLER = "fmw_12.2.1.3.0_wls_Disk1_1of1.zip" ;
21
22
private static final String P27342434_INSTALLER = "p27342434_122130_Generic.zip" ;
22
23
private static final String P28186730_INSTALLER = "p28186730_139400_Generic.zip" ;
24
+ private static final String P22987840_INSTALLER = "p22987840_122100_Generic.zip" ;
23
25
private static final String WDT_INSTALLER = "weblogic-deploy.zip" ;
24
26
private static final String FMW_INSTALLER = "fmw_12.2.1.3.0_infrastructure_Disk1_1of1.zip" ;
27
+ private static final String FMW_INSTALLER_1221 = "fmw_12.2.1.0.0_infrastructure_Disk1_1of1.zip" ;
25
28
private static final String TEST_ENTRY_KEY = "mytestEntryKey" ;
26
29
private static final String P27342434_ID = "27342434" ;
27
30
private static final String P28186730_ID = "28186730" ;
31
+ private static final String P22987840_ID = "22987840" ;
28
32
private static final String WLS_VERSION = "12.2.1.3.0" ;
33
+ private static final String WLS_VERSION_1221 = "12.2.1.0.0" ;
29
34
private static final String OPATCH_VERSION = "13.9.4.0.0" ;
30
35
private static final String JDK_VERSION = "8u202" ;
36
+ private static final String JDK_VERSION_8u212 = "8u212" ;
31
37
private static final String WDT_VERSION = "1.1.1" ;
32
38
private static final String WDT_ARCHIVE = "archive.zip" ;
33
39
private static final String WDT_VARIABLES = "domain.properties" ;
@@ -56,6 +62,10 @@ public static void staticUnprepare() throws Exception {
56
62
cleanup ();
57
63
}
58
64
65
+ /**
66
+ * test cache listItems
67
+ * @throws Exception - if any error occurs
68
+ */
59
69
@ Test
60
70
public void test1CacheListItems () throws Exception {
61
71
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
@@ -70,6 +80,10 @@ public void test1CacheListItems() throws Exception {
70
80
logTestEnd (testMethodName );
71
81
}
72
82
83
+ /**
84
+ * add JDK installer to the cache
85
+ * @throws Exception - if any error occurs
86
+ */
73
87
@ Test
74
88
public void test2CacheAddInstallerJDK () throws Exception {
75
89
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
@@ -85,6 +99,10 @@ public void test2CacheAddInstallerJDK() throws Exception {
85
99
logTestEnd (testMethodName );
86
100
}
87
101
102
+ /**
103
+ * add WLS installer to the cache
104
+ * @throws Exception - if any error occurs
105
+ */
88
106
@ Test
89
107
public void test3CacheAddInstallerWLS () throws Exception {
90
108
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
@@ -100,6 +118,10 @@ public void test3CacheAddInstallerWLS() throws Exception {
100
118
logTestEnd (testMethodName );
101
119
}
102
120
121
+ /**
122
+ * create a WLS image with default WLS version
123
+ * @throws Exception
124
+ */
103
125
@ Test
104
126
public void test4CreateWLSImg () throws Exception {
105
127
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
@@ -115,6 +137,10 @@ public void test4CreateWLSImg() throws Exception {
115
137
logTestEnd (testMethodName );
116
138
}
117
139
140
+ /**
141
+ * add Patch to the cache
142
+ * @throws Exception - if any error occurs
143
+ */
118
144
@ Test
119
145
public void test5CacheAddPatch () throws Exception {
120
146
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
@@ -132,6 +158,10 @@ public void test5CacheAddPatch() throws Exception {
132
158
logTestEnd (testMethodName );
133
159
}
134
160
161
+ /**
162
+ * add an entry to the cache
163
+ * @throws Exception - if any error occurs
164
+ */
135
165
@ Test
136
166
public void test6CacheAddEntry () throws Exception {
137
167
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
@@ -148,6 +178,10 @@ public void test6CacheAddEntry() throws Exception {
148
178
logTestEnd (testMethodName );
149
179
}
150
180
181
+ /**
182
+ * test delete an entry from the cache
183
+ * @throws Exception - if any error occurs
184
+ */
151
185
@ Test
152
186
public void test7CacheDeleteEntry () throws Exception {
153
187
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
@@ -164,6 +198,11 @@ public void test7CacheDeleteEntry() throws Exception {
164
198
logTestEnd (testMethodName );
165
199
}
166
200
201
+ /**
202
+ * create a WLS image without internet connection
203
+ * you need to have OCIR credentials to download the base OS docker image
204
+ * @throws Exception - if any error occurs
205
+ */
167
206
@ Test
168
207
public void test8CreateWLSImgUseCache () throws Exception {
169
208
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
@@ -185,6 +224,10 @@ public void test8CreateWLSImgUseCache() throws Exception {
185
224
logTestEnd (testMethodName );
186
225
}
187
226
227
+ /**
228
+ * update a WLS image with a patch
229
+ * @throws Exception - if any error occurs
230
+ */
188
231
@ Test
189
232
public void test9UpdateWLSImg () throws Exception {
190
233
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
@@ -201,6 +244,10 @@ public void test9UpdateWLSImg() throws Exception {
201
244
logTestEnd (testMethodName );
202
245
}
203
246
247
+ /**
248
+ * create a WLS image using Weblogic Deploying Tool
249
+ * @throws Exception - if any error occurs
250
+ */
204
251
@ Test
205
252
public void testACreateWLSImgUsingWDT () throws Exception {
206
253
@@ -251,6 +298,11 @@ public void testACreateWLSImgUsingWDT() throws Exception {
251
298
logTestEnd (testMethodName );
252
299
}
253
300
301
+ /**
302
+ * create a FMW image with full internet access
303
+ * You need to provide Oracle Support credentials to download the patches
304
+ * @throws Exception - if any error occurs
305
+ */
254
306
@ Test
255
307
public void testBCreateFMWImgFullInternetAccess () throws Exception {
256
308
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
@@ -287,4 +339,40 @@ public void testBCreateFMWImgFullInternetAccess() throws Exception {
287
339
verifyDockerImages (testMethodName );
288
340
logTestEnd (testMethodName );
289
341
}
342
+
343
+ /**
344
+ * create a FMW image with non default JDK, FMW versions
345
+ * You need to download the jdk, fmw and patch installers from Oracle first
346
+ * @throws Exception - if any error occurs
347
+ */
348
+ @ Test
349
+ public void testCCreateFMWImgNonDefault () throws Exception {
350
+ String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
351
+ logTestBegin (testMethodName );
352
+
353
+ // download the installers with non default version
354
+ downloadInstallers (JDK_INSTALLER_8u212 , FMW_INSTALLER_1221 , P22987840_INSTALLER );
355
+
356
+ // add fmw installer to the cache
357
+ String fmwPath = getInstallerCacheDir () + FS + FMW_INSTALLER_1221 ;
358
+ addInstallerToCache ("fmw" , WLS_VERSION_1221 , fmwPath );
359
+
360
+ // add jdk installer to the cache
361
+ String jdkPath = getInstallerCacheDir () + FS + JDK_INSTALLER_8u212 ;
362
+ addInstallerToCache ("jdk" , JDK_VERSION_8u212 , jdkPath );
363
+
364
+ // add the patch to the cache
365
+ String patchPath = getInstallerCacheDir () + FS + P22987840_INSTALLER ;
366
+ addPatchToCache ("fmw" , P22987840_ID , WLS_VERSION_1221 , patchPath );
367
+
368
+ String command = imagetool + " create --jdkVersion " + JDK_VERSION_8u212 + " --version=" + WLS_VERSION_1221 +
369
+ " --tag imagetool:" + testMethodName + " --patches " + P22987840_ID + " --type fmw" ;
370
+ logger .info ("Executing command: " + command );
371
+ ExecCommand .exec (command , true );
372
+
373
+ // verify the docker image is created
374
+ verifyDockerImages (testMethodName );
375
+
376
+ logTestEnd (testMethodName );
377
+ }
290
378
}
0 commit comments