24
24
@ FixMethodOrder (MethodSorters .NAME_ASCENDING )
25
25
public class ITPodsRestart extends BaseTest {
26
26
27
- // property file used to customize operator properties for operator inputs yaml
28
- private static String operator1File = "operator1.yaml" ;
29
-
30
- // file used to customize domain properties for domain, PV and LB inputs yaml
31
27
private static Domain domain = null ;
32
- private static String domainonpvwlstFile = "domainonpvwlst.yaml" ;
33
-
34
- // property file used to configure constants for integration tests
35
- private static String appPropsFile = "OperatorIT.properties" ;
36
-
37
28
private static Operator operator1 ;
38
29
39
- private static boolean QUICKTEST ;
40
- private static boolean SMOKETEST ;
41
- private static boolean JENKINS ;
42
- private static boolean INGRESSPERDOMAIN = true ;
43
-
44
- // Set QUICKTEST env var to true to run a small subset of tests.
45
- // Set SMOKETEST env var to true to run an even smaller subset
46
- // of tests, plus leave domain1 up and running when the test completes.
47
- // set INGRESSPERDOMAIN to false to create LB's ingress by kubectl yaml file
48
- static {
49
- QUICKTEST =
50
- System .getenv ("QUICKTEST" ) != null && System .getenv ("QUICKTEST" ).equalsIgnoreCase ("true" );
51
- SMOKETEST =
52
- System .getenv ("SMOKETEST" ) != null && System .getenv ("SMOKETEST" ).equalsIgnoreCase ("true" );
53
- if (SMOKETEST ) QUICKTEST = true ;
54
- if (System .getenv ("JENKINS" ) != null ) {
55
- JENKINS = new Boolean (System .getenv ("JENKINS" )).booleanValue ();
56
- }
57
- if (System .getenv ("INGRESSPERDOMAIN" ) != null ) {
58
- INGRESSPERDOMAIN = new Boolean (System .getenv ("INGRESSPERDOMAIN" )).booleanValue ();
59
- }
60
- }
61
-
62
30
/**
63
31
* This method gets called only once before any of the test methods are executed. It does the
64
32
* initialization of the integration test properties defined in OperatorIT.properties and setting
@@ -71,11 +39,11 @@ public class ITPodsRestart extends BaseTest {
71
39
public static void staticPrepare () throws Exception {
72
40
// initialize test properties and create the directories
73
41
if (!QUICKTEST ) {
74
- initialize (appPropsFile );
42
+ initialize (APP_PROPS_FILE );
75
43
76
44
logger .info ("Checking if operator1 and domain are running, if not creating" );
77
45
if (operator1 == null ) {
78
- operator1 = TestUtils .createOperator (operator1File );
46
+ operator1 = TestUtils .createOperator (OPERATOR1_YAML );
79
47
}
80
48
81
49
domain = createPodsRestartdomain ();
@@ -95,13 +63,8 @@ public static void staticUnPrepare() throws Exception {
95
63
logger .info ("BEGIN" );
96
64
logger .info ("Run once, release cluster lease" );
97
65
98
- // destroyPodsRestartdomain();
99
- // tearDown();
100
-
101
- if (!"" .equals (getLeaseId ())) {
102
- logger .info ("Release the k8s cluster lease" );
103
- TestUtils .releaseLease (getProjectRoot (), getLeaseId ());
104
- }
66
+ destroyPodsRestartdomain ();
67
+ tearDown ();
105
68
106
69
logger .info ("SUCCESS" );
107
70
}
@@ -211,22 +174,24 @@ public void testServerRestartByChangingImage() throws Exception {
211
174
logTestBegin (testMethodName );
212
175
213
176
boolean testCompletedSuccessfully = false ;
214
-
215
- logger .info (
216
- "About to testDomainServerRestart for Domain: "
217
- + domain .getDomainUid ()
218
- + " Image property: store/oracle/weblogic:12.2.1.3 to store/oracle/weblogic:duplicate" );
219
- TestUtils .dockerTagImage ("store/oracle/weblogic:12.2.1.3" , "store/oracle/weblogic:duplicate" );
220
- domain .testDomainServerRestart (
221
- "\" store/oracle/weblogic:12.2.1.3\" " , "\" store/oracle/weblogic:duplicate\" " );
222
- TestUtils .dockerRemoveImage ("store/oracle/weblogic:duplicate" );
177
+ try {
178
+ logger .info (
179
+ "About to testDomainServerRestart for Domain: "
180
+ + domain .getDomainUid ()
181
+ + " Image property: store/oracle/weblogic:12.2.1.3 to store/oracle/weblogic:duplicate" );
182
+ TestUtils .dockerTagImage ("store/oracle/weblogic:12.2.1.3" , "store/oracle/weblogic:duplicate" );
183
+ domain .testDomainServerRestart (
184
+ "\" store/oracle/weblogic:12.2.1.3\" " , "\" store/oracle/weblogic:duplicate\" " );
185
+ } finally {
186
+ TestUtils .dockerRemoveImage ("store/oracle/weblogic:duplicate" );
187
+ }
223
188
224
189
logger .info ("SUCCESS - " + testMethodName );
225
190
}
226
191
227
192
private static Domain createPodsRestartdomain () throws Exception {
228
193
229
- Map <String , Object > domainMap = TestUtils .loadYaml (domainonpvwlstFile );
194
+ Map <String , Object > domainMap = TestUtils .loadYaml (DOMAINONPV_WLST_YAML );
230
195
domainMap .put ("domainUID" , "domainpodsrestart" );
231
196
domainMap .put ("adminNodePort" , new Integer ("30707" ));
232
197
domainMap .put ("t3ChannelPort" , new Integer ("30081" ));
0 commit comments