6
6
7
7
import java .util .ArrayList ;
8
8
import java .util .Map ;
9
-
10
9
import oracle .kubernetes .operator .utils .Domain ;
11
10
import oracle .kubernetes .operator .utils .ExecCommand ;
12
11
import oracle .kubernetes .operator .utils .ExecResult ;
13
12
import oracle .kubernetes .operator .utils .Operator ;
14
13
import oracle .kubernetes .operator .utils .Operator .RestCertType ;
15
14
import oracle .kubernetes .operator .utils .TestUtils ;
16
- import org .junit .AfterClass ;
17
15
import org .junit .Assume ;
18
16
import org .junit .BeforeClass ;
19
17
import org .junit .FixMethodOrder ;
20
- import org .junit .Ignore ;
21
18
import org .junit .Test ;
22
19
import org .junit .runners .MethodSorters ;
23
20
@@ -54,7 +51,7 @@ public static void staticPrepare() throws Exception {
54
51
*
55
52
* @throws Exception exception
56
53
*/
57
- @ AfterClass
54
+ // @AfterClass
58
55
public static void staticUnPrepare () throws Exception {
59
56
if (!QUICKTEST ) {
60
57
logger .info ("+++++++++++++++++++++++++++++++++---------------------------------+" );
@@ -133,17 +130,17 @@ public void testCreateSecondOperatorUsingSameOperatorNsNegativeInstall() throws
133
130
Operator firstoperator = null ;
134
131
Operator secondoperator = null ;
135
132
133
+ logger .info ("Creating firs toperator" );
134
+ firstoperator =
135
+ new Operator (TestUtils .createOperatorMap (number , true ), RestCertType .SELF_SIGNED );
136
+ firstoperator .callHelmInstall ();
137
+ number = number + 1 ;
138
+ oprelease = "op" + number ;
139
+ logger .info (" new value for oprelease" + oprelease );
140
+ Map <String , Object > operatorMap = TestUtils .createOperatorMap (number , true );
141
+ operatorMap .replace ("namespace" , firstoperator .getOperatorMap ().get ("namespace" ));
142
+ secondoperator = new Operator (operatorMap , false , true , true , RestCertType .SELF_SIGNED );
136
143
try {
137
- logger .info ("Creating firs toperator" );
138
- firstoperator =
139
- new Operator (TestUtils .createOperatorMap (number , true ), RestCertType .SELF_SIGNED );
140
- firstoperator .callHelmInstall ();
141
- number = number + 1 ;
142
- oprelease = "op" + number ;
143
- logger .info (" new value for oprelease" + oprelease );
144
- Map <String , Object > operatorMap = TestUtils .createOperatorMap (number , true );
145
- operatorMap .replace ("namespace" , firstoperator .getOperatorMap ().get ("namespace" ));
146
- secondoperator = new Operator (operatorMap , false , true , true , RestCertType .SELF_SIGNED );
147
144
secondoperator .callHelmInstall ();
148
145
throw new RuntimeException (
149
146
"FAILURE: Helm installs second operator with same namespace as the first one" );
@@ -184,16 +181,20 @@ public void testCreateSecondOperatorUsingSameOperatorNsNegativeInstall() throws
184
181
* @throws Exception exception
185
182
*/
186
183
@ Test
187
- @ Ignore
188
184
public void testNotPreCreatedOpNsCreateOperatorNegativeInstall () throws Exception {
189
185
Assume .assumeFalse (QUICKTEST );
190
186
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
191
187
logTestBegin (testMethodName );
192
188
Operator operator = null ;
189
+
190
+ operator =
191
+ new Operator (
192
+ (TestUtils .createOperatorMap (number , false )),
193
+ false ,
194
+ false ,
195
+ true ,
196
+ RestCertType .SELF_SIGNED );
193
197
try {
194
- operator =
195
- new Operator (
196
- (TestUtils .createOperatorMap (number , false )), false , false , true , RestCertType .NONE );
197
198
operator .callHelmInstall ();
198
199
throw new RuntimeException ("FAILURE: Helm install operator with not preexisted namespace " );
199
200
@@ -221,16 +222,20 @@ public void testNotPreCreatedOpNsCreateOperatorNegativeInstall() throws Exceptio
221
222
* @throws Exception exception
222
223
*/
223
224
@ Test
224
- @ Ignore
225
225
public void testNotPreexistedOpServiceAccountCreateOperatorNegativeInstall () throws Exception {
226
226
Assume .assumeFalse (QUICKTEST );
227
227
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
228
228
logTestBegin (testMethodName );
229
229
Operator operator = null ;
230
+
231
+ operator =
232
+ new Operator (
233
+ (TestUtils .createOperatorMap (number , false )),
234
+ true ,
235
+ false ,
236
+ true ,
237
+ RestCertType .SELF_SIGNED );
230
238
try {
231
- operator =
232
- new Operator (
233
- (TestUtils .createOperatorMap (number , false )), true , false , true , RestCertType .NONE );
234
239
operator .callHelmInstall ();
235
240
throw new RuntimeException (
236
241
"FAILURE: Helm installs operator with not preexisted service account " );
@@ -240,8 +245,7 @@ public void testNotPreexistedOpServiceAccountCreateOperatorNegativeInstall() thr
240
245
logger .info ("Executing cmd " + cmdLb );
241
246
ExecResult result = ExecCommand .exec (cmdLb );
242
247
if (result .exitValue () != 0 ) {
243
- throw new RuntimeException (
244
- "FAILURE: Helm installs operator with not preexisted service account " );
248
+ throw new RuntimeException ("FAILURE: failed helm is not showed in the failed list " );
245
249
}
246
250
// create operator service account
247
251
String serviceAccount = (String ) operator .getOperatorMap ().get ("serviceAccount" );
@@ -279,25 +283,25 @@ public void testNotPreexistedOpServiceAccountCreateOperatorNegativeInstall() thr
279
283
* @throws Exception exception
280
284
*/
281
285
@ Test
282
- @ Ignore
283
286
public void testSecondOpSharingSameTargetDomainsNsNegativeInstall () throws Exception {
284
287
Assume .assumeFalse (QUICKTEST );
285
288
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
286
289
logTestBegin (testMethodName );
287
290
Operator secondoperator = null ;
288
291
Operator firstoperator = null ;
292
+
293
+ logger .info ("Creating first operator" );
294
+ firstoperator =
295
+ new Operator (TestUtils .createOperatorMap (number , true ), RestCertType .SELF_SIGNED );
296
+ firstoperator .callHelmInstall ();
297
+ number = number + 1 ;
298
+ oprelease = "op" + number ;
299
+ Map <String , Object > operatorMap = TestUtils .createOperatorMap (number , false );
300
+ ArrayList <String > targetDomainsNS =
301
+ (ArrayList <String >) firstoperator .getOperatorMap ().get ("domainNamespaces" );
302
+ operatorMap .put ("domainNamespaces" , targetDomainsNS );
303
+ secondoperator = new Operator (operatorMap , true , true , false , RestCertType .SELF_SIGNED );
289
304
try {
290
- logger .info ("Creating first operator" );
291
- firstoperator =
292
- new Operator (TestUtils .createOperatorMap (number , true ), RestCertType .SELF_SIGNED );
293
- firstoperator .callHelmInstall ();
294
- number = number + 1 ;
295
- oprelease = "op" + number ;
296
- Map <String , Object > operatorMap = TestUtils .createOperatorMap (number , false );
297
- ArrayList <String > targetDomainsNS =
298
- (ArrayList <String >) firstoperator .getOperatorMap ().get ("domainNamespaces" );
299
- operatorMap .put ("domainNamespaces" , targetDomainsNS );
300
- secondoperator = new Operator (operatorMap , true , true , false , RestCertType .NONE );
301
305
secondoperator .callHelmInstall ();
302
306
throw new RuntimeException (
303
307
"FAILURE: Helm installs second operator with same as first operator's target domains namespaces " );
@@ -342,20 +346,23 @@ public void testSecondOpSharingSameTargetDomainsNsNegativeInstall() throws Excep
342
346
* @throws Exception exception
343
347
*/
344
348
@ Test
345
- @ Ignore
346
349
public void testTargetNsIsNotPreexistedNegativeInstall () throws Exception {
347
350
Assume .assumeFalse (QUICKTEST );
348
351
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
349
352
logTestBegin (testMethodName );
350
353
Operator operator = null ;
354
+
355
+ operator =
356
+ new Operator (
357
+ TestUtils .createOperatorMap (number , false ),
358
+ true ,
359
+ true ,
360
+ false ,
361
+ RestCertType .SELF_SIGNED );
351
362
try {
352
- operator =
353
- new Operator (
354
- TestUtils .createOperatorMap (number , false ), true , true , false , RestCertType .NONE );
355
363
operator .callHelmInstall ();
356
364
throw new RuntimeException (
357
365
"FAILURE: Helm install operator with not preexisted target domains namespaces " );
358
-
359
366
} catch (Exception ex ) {
360
367
if (!ex .getMessage ()
361
368
.contains (
@@ -401,18 +408,19 @@ public void testSecondOpSharingSameExternalRestPortNegativeInstall() throws Exce
401
408
Operator operator1 = null ;
402
409
Operator operator2 = null ;
403
410
int httpsRestPort = 0 ;
404
- try {
405
- operator1 = new Operator (TestUtils .createOperatorMap (number , true ), RestCertType .SELF_SIGNED );
406
- operator1 .callHelmInstall ();
407
411
408
- httpsRestPort = (int ) operator1 .getOperatorMap ().get ("externalRestHttpsPort" );
409
- logger .info ("Creating second operator with externalRestHttpPort " + httpsRestPort );
410
- number = number + 1 ;
411
- oprelease = "op" + number ;
412
- Map <String , Object > operatorMap = TestUtils .createOperatorMap (number , true );
413
- operatorMap .replace ("externalRestHttpsPort" , httpsRestPort );
412
+ operator1 = new Operator (TestUtils .createOperatorMap (number , true ), RestCertType .SELF_SIGNED );
413
+ operator1 .callHelmInstall ();
414
414
415
- operator2 = new Operator (operatorMap , RestCertType .SELF_SIGNED );
415
+ httpsRestPort = (int ) operator1 .getOperatorMap ().get ("externalRestHttpsPort" );
416
+ logger .info ("Creating second operator with externalRestHttpPort " + httpsRestPort );
417
+ number = number + 1 ;
418
+ oprelease = "op" + number ;
419
+ Map <String , Object > operatorMap = TestUtils .createOperatorMap (number , true );
420
+ operatorMap .replace ("externalRestHttpsPort" , httpsRestPort );
421
+
422
+ operator2 = new Operator (operatorMap , RestCertType .SELF_SIGNED );
423
+ try {
416
424
operator2 .callHelmInstall ();
417
425
418
426
throw new RuntimeException (
@@ -459,12 +467,13 @@ public void testCreateWithUpperCaseTargetDomainNegativeInstall() throws Exceptio
459
467
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
460
468
logTestBegin (testMethodName );
461
469
Operator operator = null ;
470
+
471
+ Map <String , Object > operatorMap = TestUtils .createOperatorMap (number , true );
472
+ ArrayList <String > targetDomainsNS = new ArrayList <String >();
473
+ targetDomainsNS .add ("Test9" );
474
+ operatorMap .replace ("domainNamespaces" , targetDomainsNS );
475
+ operator = new Operator (operatorMap , RestCertType .SELF_SIGNED );
462
476
try {
463
- Map <String , Object > operatorMap = TestUtils .createOperatorMap (number , true );
464
- ArrayList <String > targetDomainsNS = new ArrayList <String >();
465
- targetDomainsNS .add ("Test9" );
466
- operatorMap .replace ("domainNamespaces" , targetDomainsNS );
467
- operator = new Operator (operatorMap , RestCertType .SELF_SIGNED );
468
477
operator .callHelmInstall ();
469
478
throw new RuntimeException (
470
479
"FAILURE: Helm install operator with UpperCase for target domains " );
0 commit comments