@@ -21,6 +21,7 @@ public class ITImagetool extends BaseTest {
21
21
private static final String P27342434_INSTALLER = "p27342434_122130_Generic.zip" ;
22
22
private static final String P28186730_INSTALLER = "p28186730_139400_Generic.zip" ;
23
23
private static final String WDT_INSTALLER = "weblogic-deploy.zip" ;
24
+ private static final String FMW_INSTALLER = "fmw_12.2.1.3.0_infrastructure_Disk1_1of1.zip" ;
24
25
private static final String TEST_ENTRY_KEY = "mytestEntryKey" ;
25
26
private static final String P27342434_ID = "27342434" ;
26
27
private static final String P28186730_ID = "28186730" ;
@@ -43,6 +44,9 @@ public static void staticPrepare() throws Exception {
43
44
setup ();
44
45
// pull base OS docker image used for test
45
46
pullDockerImage ();
47
+
48
+ // download the installers for the test
49
+ downloadInstallers (JDK_INSTALLER , WLS_INSTALLER , WDT_INSTALLER , P27342434_INSTALLER , P28186730_INSTALLER );
46
50
}
47
51
48
52
@ AfterClass
@@ -70,7 +74,7 @@ public void test2CacheAddInstallerJDK() throws Exception {
70
74
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
71
75
logTestBegin (testMethodName );
72
76
73
- String jdkPath = getProjectRoot () + FS + ".." + FS + "caches" + FS + JDK_INSTALLER ;
77
+ String jdkPath = getInstallerCacheDir () + FS + JDK_INSTALLER ;
74
78
addInstallerToCache ("jdk" , JDK_VERSION , jdkPath );
75
79
76
80
ExecResult result = listItemsInCache ();
@@ -85,7 +89,7 @@ public void test3CacheAddInstallerWLS() throws Exception {
85
89
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
86
90
logTestBegin (testMethodName );
87
91
88
- String wlsPath = getProjectRoot () + FS + ".." + FS + "caches" + FS + WLS_INSTALLER ;
92
+ String wlsPath = getInstallerCacheDir () + FS + WLS_INSTALLER ;
89
93
addInstallerToCache ("wls" , WLS_VERSION , wlsPath );
90
94
91
95
ExecResult result = listItemsInCache ();
@@ -115,7 +119,7 @@ public void test5CacheAddPatch() throws Exception {
115
119
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
116
120
logTestBegin (testMethodName );
117
121
118
- String patchPath = getProjectRoot () + FS + ".." + FS + "caches" + FS + P27342434_INSTALLER ;
122
+ String patchPath = getInstallerCacheDir () + FS + P27342434_INSTALLER ;
119
123
deleteEntryFromCache (P27342434_ID + "_" + WLS_VERSION );
120
124
addPatchToCache ("wls" , P27342434_ID , WLS_VERSION , patchPath );
121
125
@@ -132,7 +136,7 @@ public void test6CacheAddEntry() throws Exception {
132
136
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
133
137
logTestBegin (testMethodName );
134
138
135
- String mytestEntryValue = getProjectRoot () + FS + ".." + FS + "caches" + FS + P27342434_INSTALLER ;
139
+ String mytestEntryValue = getInstallerCacheDir () + FS + P27342434_INSTALLER ;
136
140
addEntryToCache (TEST_ENTRY_KEY , mytestEntryValue );
137
141
138
142
// verify the result
@@ -165,7 +169,7 @@ public void test8CreateWLSImgUseCache() throws Exception {
165
169
logTestBegin (testMethodName );
166
170
167
171
// need to add the required patches 28186730 for Opatch before create wls images
168
- String patchPath = getProjectRoot () + FS + ".." + FS + "caches" + FS + P28186730_INSTALLER ;
172
+ String patchPath = getInstallerCacheDir () + FS + P28186730_INSTALLER ;
169
173
addPatchToCache ("wls" , P28186730_ID , OPATCH_VERSION , patchPath );
170
174
171
175
String command = imagetool + " create --jdkVersion " + JDK_VERSION + " --fromImage " +
@@ -203,32 +207,34 @@ public void testACreateWLSImgUsingWDT() throws Exception {
203
207
logTestBegin (testMethodName );
204
208
205
209
// add WDT installer to the cache
206
- String wdtPath = getProjectRoot () + FS + ".." + FS + "caches" + FS + WDT_INSTALLER ;
210
+ String wdtPath = getInstallerCacheDir () + FS + WDT_INSTALLER ;
207
211
addInstallerToCache ("wdt" , WDT_VERSION , wdtPath );
208
212
209
213
// add WLS installer to the cache
210
- String wlsPath = getProjectRoot () + FS + ".." + FS + "caches" + FS + WLS_INSTALLER ;
214
+ String wlsPath = getInstallerCacheDir () + FS + WLS_INSTALLER ;
211
215
addInstallerToCache ("wls" , WLS_VERSION , wlsPath );
212
216
213
217
// add jdk installer to the cache
214
- String jdkPath = getProjectRoot () + FS + ".." + FS + "caches" + FS + JDK_INSTALLER ;
218
+ String jdkPath = getInstallerCacheDir () + FS + JDK_INSTALLER ;
215
219
addInstallerToCache ("jdk" , JDK_VERSION , jdkPath );
216
220
217
221
// need to add the required patches 28186730 for Opatch before create wls images
218
222
// delete the cache entry first
219
223
deleteEntryFromCache (P28186730_ID + "_opatch" );
220
- String patchPath = getProjectRoot () + FS + ".." + FS + "caches" + FS + P28186730_INSTALLER ;
224
+ String patchPath = getInstallerCacheDir () + FS + P28186730_INSTALLER ;
221
225
addPatchToCache ("wls" , P28186730_ID , OPATCH_VERSION , patchPath );
222
226
223
227
// add the patch to the cache
224
228
deleteEntryFromCache (P27342434_ID + "_" + WLS_VERSION );
225
- patchPath = getProjectRoot () + FS + ".." + FS + "caches" + FS + P27342434_INSTALLER ;
229
+ patchPath = getInstallerCacheDir () + FS + P27342434_INSTALLER ;
226
230
addPatchToCache ("wls" , P27342434_ID , WLS_VERSION , patchPath );
227
231
228
- String wdtResourcePath = getProjectRoot () + FS + "src" + FS + "test" + FS + "resources" + FS + "wdt" + FS ;
229
- String wdtArchive = wdtResourcePath + WDT_ARCHIVE ;
230
- String wdtModel = wdtResourcePath + WDT_MODEL ;
231
- String wdtVariables = wdtResourcePath + WDT_VARIABLES ;
232
+ // build the wdt archive
233
+ buildWDTArchive ();
234
+
235
+ String wdtArchive = getWDTResourcePath () + FS + WDT_ARCHIVE ;
236
+ String wdtModel = getWDTResourcePath () + FS + WDT_MODEL ;
237
+ String wdtVariables = getWDTResourcePath () + FS + WDT_VARIABLES ;
232
238
String command = imagetool + " create --fromImage " +
233
239
BASE_OS_IMG + ":" + BASE_OS_IMG_TAG + " --tag imagetool:" + testMethodName +
234
240
" --version " + WLS_VERSION + " --patches " + P27342434_ID + " --wdtVersion " + WDT_VERSION +
@@ -243,4 +249,41 @@ public void testACreateWLSImgUsingWDT() throws Exception {
243
249
244
250
logTestEnd (testMethodName );
245
251
}
252
+
253
+ @ Test
254
+ public void testBCreateFMWImgFullInternetAccess () throws Exception {
255
+ String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
256
+ logTestBegin (testMethodName );
257
+
258
+ String user = System .getenv ("ORACLE_SUPPORT_USERNAME" );
259
+ String password = System .getenv ("ORACLE_SUPPORT_PASSWORD" );
260
+ if (user == null || password == null ) {
261
+ throw new Exception ("Please set environment variables ORACLE_SUPPORT_USERNAME and ORACLE_SUPPORT_PASSWORD" +
262
+ " for Oracle Support credentials to download the patches." );
263
+ }
264
+
265
+ String httpProxy = System .getenv ("HTTP_PROXY" );
266
+ String httpsProxy = System .getenv ("HTTPS_PROXY" );
267
+ if (httpProxy == null || httpsProxy == null ) {
268
+ throw new Exception ("Please set environment variable HTTP_PROXY and HTTPS_PROXY" );
269
+ }
270
+
271
+ // add fmw installer to the cache
272
+ String fmwPath = getInstallerCacheDir () + FS + FMW_INSTALLER ;
273
+ addInstallerToCache ("fmw" , WLS_VERSION , fmwPath );
274
+
275
+ // add jdk installer to the cache
276
+ String jdkPath = getInstallerCacheDir () + FS + JDK_INSTALLER ;
277
+ addInstallerToCache ("jdk" , JDK_VERSION , jdkPath );
278
+
279
+ String command = imagetool + " create --version=" + WLS_VERSION + " --tag imagetool:" + testMethodName +
280
+ " --latestPSU --user " + user + " --passwordEnv ORACLE_SUPPORT_PASSWORD --httpProxyUrl " +
281
+ httpProxy + " --httpsProxyUrl " + httpsProxy + " --type fmw" ;
282
+ logger .info ("Executing command: " + command );
283
+ ExecCommand .exec (command , true );
284
+
285
+ // verify the docker image is created
286
+ verifyDockerImages (testMethodName );
287
+ logTestEnd (testMethodName );
288
+ }
246
289
}
0 commit comments