@@ -53,27 +53,33 @@ protected static void initialize() throws Exception {
53
53
54
54
protected static void setup () throws Exception {
55
55
56
- logger .info ("Setting up the test ..." );
56
+ logger .info ("Setting up the test environment ..." );
57
57
String command = "/bin/rm -rf " + getImagetoolHome ();
58
- logger .info ("Executing command: " + command );
59
- ExecCommand .exec (command );
58
+ executeNoVerify (command );
60
59
61
60
// unzip the weblogic-image-tool/imagetool/target/imagetool-${VERSION}-SNAPSHOT.zip
62
61
command = "/bin/unzip " + getTargetDir () + FS + imagetoolZipfile ;
63
- logger .info ("Executing command: " + command );
64
- ExecCommand .exec (command );
62
+ executeNoVerify (command );
65
63
66
64
command = "source " + getImagetoolHome () + FS + "bin" + FS + "setup.sh" ;
67
- logger .info ("Executing command: " + command );
68
- ExecCommand .exec (command );
65
+ executeNoVerify (command );
69
66
}
70
67
71
68
protected static void cleanup () throws Exception {
72
- logger .info ("cleaning up cache entries" );
73
- logger .info ("executing command: /bin/rm -rf " + wlsImgCacheDir );
74
- ExecCommand .exec ("/bin/rm -rf " + wlsImgCacheDir );
75
- logger .info ("executing command: /bin/mkdir " + wlsImgCacheDir );
76
- ExecCommand .exec ("/bin/mkdir " + wlsImgCacheDir );
69
+ logger .info ("cleaning up the test environment ..." );
70
+ String command = "/bin/rm -rf " + wlsImgCacheDir ;
71
+ executeNoVerify (command );
72
+
73
+ command = "/bin/mkdir " + wlsImgCacheDir ;
74
+ executeNoVerify (command );
75
+
76
+ // clean up the docker images
77
+ command = "docker rmi -f " + BASE_OS_IMG + ":" + BASE_OS_IMG_TAG ;
78
+ executeNoVerify (command );
79
+
80
+ // clean up the possible left over wlsimgbuilder_temp*
81
+ command = "/bin/rm -rf " + wlsImgBldDir + FS + "wlsimgbuilder_temp*" ;
82
+ executeNoVerify (command );
77
83
}
78
84
79
85
protected static void pullDockerImage () throws Exception {
@@ -134,6 +140,11 @@ protected static String getWDTResourcePath() {
134
140
return getProjectRoot () + FS + "src" + FS + "test" + FS + "resources" + FS + "wdt" ;
135
141
}
136
142
143
+ protected static void executeNoVerify (String command ) throws Exception {
144
+ logger .info ("executing command: " + command );
145
+ ExecCommand .exec (command );
146
+ }
147
+
137
148
protected void verifyResult (ExecResult result , String matchString ) throws Exception {
138
149
if (result .exitValue () != 0 || !result .stdout ().contains (matchString )) {
139
150
throw new Exception ("verifying test result failed." );
0 commit comments