1
1
// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
2
2
// Licensed under the Universal Permissive License v 1.0 as shown at
3
3
// http://oss.oracle.com/licenses/upl.
4
+
4
5
package oracle .kubernetes .operator ;
5
6
6
7
import java .nio .file .Files ;
24
25
* extend this class.
25
26
*/
26
27
public class BaseTest {
27
-
28
28
public static final Logger logger = Logger .getLogger ("OperatorIT" , "OperatorIT" );
29
29
public static final String TESTWEBAPP = "testwebapp" ;
30
30
31
31
// property file used to customize operator properties for operator inputs yaml
32
+
32
33
public static final String OPERATOR1_YAML = "operator1.yaml" ;
33
34
public static final String OPERATOR2_YAML = "operator2.yaml" ;
34
35
public static final String OPERATORBC_YAML = "operator_bc.yaml" ;
@@ -73,9 +74,7 @@ public class BaseTest {
73
74
System .getenv ("QUICKTEST" ) != null && System .getenv ("QUICKTEST" ).equalsIgnoreCase ("true" );
74
75
SMOKETEST =
75
76
System .getenv ("SMOKETEST" ) != null && System .getenv ("SMOKETEST" ).equalsIgnoreCase ("true" );
76
- if (SMOKETEST ) {
77
- QUICKTEST = true ;
78
- }
77
+ if (SMOKETEST ) QUICKTEST = true ;
79
78
if (System .getenv ("JENKINS" ) != null ) {
80
79
JENKINS = new Boolean (System .getenv ("JENKINS" )).booleanValue ();
81
80
}
@@ -139,30 +138,6 @@ public static void initialize(String appPropsFile) throws Exception {
139
138
+ clnResult .stderr ());
140
139
}
141
140
142
- // create resultRoot, PVRoot, etc
143
- Files .createDirectories (Paths .get (resultRoot ));
144
- Files .createDirectories (Paths .get (resultDir ));
145
- Files .createDirectories (Paths .get (userProjectsDir ));
146
-
147
- // create file handler
148
- FileHandler fh = new FileHandler (resultDir + "/java_test_suite.out" , true );
149
- SimpleFormatter formatter = new SimpleFormatter ();
150
- fh .setFormatter (formatter );
151
- logger .addHandler (fh );
152
- logger .log (
153
- Level .INFO , "Adding file handler, logging to file at {0}/java_test_suite.out" , resultDir );
154
-
155
- // for manual/local run, create file handler, create PVROOT
156
- if (System .getenv ("WERCKER" ) == null && System .getenv ("JENKINS" ) == null ) {
157
- logger .log (Level .INFO , "Creating PVROOT {0}" , pvRoot );
158
- Files .createDirectories (Paths .get (pvRoot ));
159
- ExecResult result = ExecCommand .exec ("chmod 777 " + pvRoot );
160
- if (result .exitValue () != 0 ) {
161
- throw new RuntimeException (
162
- "FAILURE: Couldn't change permissions for PVROOT " + result .stderr ());
163
- }
164
- }
165
-
166
141
if (System .getenv ("JENKINS" ) != null ) {
167
142
logger .info ("Creating " + resultRoot + "/acceptance_test_tmp" );
168
143
TestUtils .exec (
@@ -184,6 +159,29 @@ public static void initialize(String appPropsFile) throws Exception {
184
159
+ "/acceptance_test_pv\" " );
185
160
}
186
161
162
+ // create resultRoot, PVRoot, etc
163
+ Files .createDirectories (Paths .get (resultRoot ));
164
+ Files .createDirectories (Paths .get (resultDir ));
165
+ Files .createDirectories (Paths .get (userProjectsDir ));
166
+
167
+ // create file handler
168
+ FileHandler fh = new FileHandler (resultDir + "/java_test_suite.out" );
169
+ SimpleFormatter formatter = new SimpleFormatter ();
170
+ fh .setFormatter (formatter );
171
+ logger .addHandler (fh );
172
+ logger .info ("Adding file handler, logging to file at " + resultDir + "/java_test_suite.out" );
173
+
174
+ // for manual/local run, create file handler, create PVROOT
175
+ if (System .getenv ("WERCKER" ) == null && System .getenv ("JENKINS" ) == null ) {
176
+ logger .info ("Creating PVROOT " + pvRoot );
177
+ Files .createDirectories (Paths .get (pvRoot ));
178
+ ExecResult result = ExecCommand .exec ("chmod 777 " + pvRoot );
179
+ if (result .exitValue () != 0 ) {
180
+ throw new RuntimeException (
181
+ "FAILURE: Couldn't change permissions for PVROOT " + result .stderr ());
182
+ }
183
+ }
184
+
187
185
logger .info ("appProps = " + appProps );
188
186
logger .info ("maxIterationPod = " + appProps .getProperty ("maxIterationsPod" ));
189
187
logger .info (
@@ -270,9 +268,11 @@ public void testAdminT3Channel(Domain domain) throws Exception {
270
268
* at weblogic.cluster.UnicastSender.send(UnicastSender.java:21)
271
269
* Truncated. see log file for complete stacktrace
272
270
*/
271
+
273
272
if (domainMap .containsKey ("domainHomeImageBase" )) {
274
273
if (domainMap .get ("initialManagedServerReplicas" ) != null
275
274
&& ((Integer ) domainMap .get ("initialManagedServerReplicas" )).intValue () >= 1 ) {
275
+
276
276
result =
277
277
ExecCommand .exec (
278
278
"kubectl logs "
0 commit comments