1
- // Copyright (c) 2020, 2022 , Oracle and/or its affiliates.
1
+ // Copyright (c) 2020, 2023 , Oracle and/or its affiliates.
2
2
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3
3
4
4
package oracle .weblogic .kubernetes ;
@@ -132,7 +132,6 @@ class ItUsabilityOperatorHelmChart {
132
132
private final String domain5Uid = "usabdomain5" ;
133
133
134
134
private final String clusterName = "cluster-1" ;
135
- private final int managedServerPort = 8001 ;
136
135
private final int replicaCount = 2 ;
137
136
private final String adminServerPrefix = "-" + ADMIN_SERVER_NAME_BASE ;
138
137
private final String managedServerPrefix = "-" + MANAGED_SERVER_NAME_BASE ;
@@ -141,9 +140,7 @@ class ItUsabilityOperatorHelmChart {
141
140
private int replicaCountDomain1 = 2 ;
142
141
private int replicaCountDomain2 = 2 ;
143
142
private String adminSvcExtRouteHost = null ;
144
-
145
- // ingress host list
146
- private List <String > ingressHostList ;
143
+
147
144
private static LoggingFacade logger = null ;
148
145
149
146
/**
@@ -252,7 +249,7 @@ void testDeleteOperatorButNotDomain() {
252
249
}
253
250
// delete operator
254
251
logger .info ("Uninstalling operator" );
255
- uninstallOperator (opHelmParams );
252
+ uninstallOperatorAndVerify (opHelmParams );
256
253
cleanUpSA (opNamespace );
257
254
deleteSecret (TEST_IMAGES_REPO_SECRET_NAME , opNamespace );
258
255
@@ -337,7 +334,7 @@ void testCreateDeleteCreateOperatorButNotDomain() {
337
334
}
338
335
// delete operator
339
336
logger .info ("Uninstalling operator" );
340
- uninstallOperator (opHelmParams );
337
+ uninstallOperatorAndVerify (opHelmParams );
341
338
342
339
//install second time
343
340
opHelmParams = installOperatorHelmChart (opNamespace , opServiceAccount , false , true , false ,
@@ -363,7 +360,7 @@ void testCreateDeleteCreateOperatorButNotDomain() {
363
360
logger .info ("Domain1 scaled to " + replicaCountDomain1 + " servers" );
364
361
365
362
} finally {
366
- uninstallOperator (op1HelmParams );
363
+ uninstallOperatorAndVerify (op1HelmParams );
367
364
deleteSecret (TEST_IMAGES_REPO_SECRET_NAME ,opNamespace );
368
365
cleanUpSA (opNamespace );
369
366
if (!isDomain1Running ) {
@@ -477,7 +474,7 @@ void testAddRemoveDomainNameSpacesOnOperator() {
477
474
"operator can still manage domain1, scaling was succeeded for " + managedServerPodName1 );
478
475
479
476
} finally {
480
- uninstallOperator (op1HelmParams );
477
+ uninstallOperatorAndVerify (op1HelmParams );
481
478
deleteSecret (TEST_IMAGES_REPO_SECRET_NAME ,op2Namespace );
482
479
cleanUpSA (op2Namespace );
483
480
if (!isDomain2Running ) {
@@ -521,8 +518,8 @@ void testCreateSecondOperatorUsingSameOperatorNsNegativeInstall() {
521
518
assertNull (opHelmParam2 ,
522
519
"FAILURE: Helm installs operator in the same namespace as first operator installed " );
523
520
} finally {
524
- uninstallOperator (opHelmParams );
525
- uninstallOperator (op2HelmParams );
521
+ uninstallOperatorAndVerify (opHelmParams );
522
+ uninstallOperatorAndVerify (op2HelmParams );
526
523
deleteSecret (TEST_IMAGES_REPO_SECRET_NAME ,opNamespace );
527
524
cleanUpSA (opNamespace );
528
525
if (!isDomain1Running ) {
@@ -566,8 +563,8 @@ void testSecondOpSharingSameDomainNamespacesNegativeInstall() {
566
563
expectedError ,"failed" , 0 , op2HelmParams , domain2Namespace );
567
564
assertNull (opHelmParam2 , "FAILURE: Helm installs operator in the same namespace as first operator installed " );
568
565
} finally {
569
- uninstallOperator (opHelmParams );
570
- uninstallOperator (op2HelmParams );
566
+ uninstallOperatorAndVerify (opHelmParams );
567
+ uninstallOperatorAndVerify (op2HelmParams );
571
568
deleteSecret (TEST_IMAGES_REPO_SECRET_NAME ,opNamespace );
572
569
cleanUpSA (opNamespace );
573
570
cleanUpSA (op2Namespace );
@@ -613,9 +610,9 @@ void testSecondOpSharingSameExternalRestPortNegativeInstall() {
613
610
expectedError ,"failed" ,
614
611
externalRestHttpsPort , op2HelmParams , domain2Namespace );
615
612
assertNull (opHelmParam2 , "FAILURE: Helm installs operator in the same namespace as first operator installed " );
616
- uninstallOperator (op2HelmParams );
613
+ uninstallOperatorAndVerify (op2HelmParams );
617
614
} finally {
618
- uninstallOperator (opHelmParams );
615
+ uninstallOperatorAndVerify (opHelmParams );
619
616
deleteSecret (TEST_IMAGES_REPO_SECRET_NAME ,opNamespace );
620
617
deleteSecret (TEST_IMAGES_REPO_SECRET_NAME ,op2Namespace );
621
618
cleanUpSA (opNamespace );
@@ -645,7 +642,7 @@ void testNotPreCreatedOpNsCreateOperatorNegativeInstall() {
645
642
false , expectedError ,"failed" , 0 , op2HelmParams , domain2Namespace );
646
643
assertNull (opHelmParam2 , "FAILURE: Helm installs operator in the same namespace as first operator installed " );
647
644
} finally {
648
- uninstallOperator (op2HelmParams );
645
+ uninstallOperatorAndVerify (op2HelmParams );
649
646
}
650
647
}
651
648
@@ -711,7 +708,7 @@ void testCreateWithEmptyDomainNamespaceInstall() {
711
708
712
709
713
710
} finally {
714
- uninstallOperator (op2HelmParams );
711
+ uninstallOperatorAndVerify (op2HelmParams );
715
712
deleteSecret (TEST_IMAGES_REPO_SECRET_NAME ,op2Namespace );
716
713
cleanUpSA (op2Namespace );
717
714
if (!isDomain2Running ) {
@@ -784,7 +781,7 @@ void testNotPreexistedOpServiceAccountCreateOperatorNegativeInstall() {
784
781
assertNotNull (errorMsg , "Expected error message for missing ServiceAccount not found" );
785
782
} finally {
786
783
//uninstall operator helm chart
787
- uninstallOperator (opHelmParams );
784
+ uninstallOperatorAndVerify (opHelmParams );
788
785
deleteSecret (TEST_IMAGES_REPO_SECRET_NAME ,op2Namespace );
789
786
cleanUpSA (op2Namespace );
790
787
}
@@ -891,7 +888,7 @@ void testTwoDomainsInSameNameSpaceOnOperator() {
891
888
} catch (Exception ex ) {
892
889
logger .info ("Failed to collect operator log" );
893
890
}
894
- uninstallOperator (op1HelmParams );
891
+ uninstallOperatorAndVerify (op1HelmParams );
895
892
deleteSecret (TEST_IMAGES_REPO_SECRET_NAME ,op3Namespace );
896
893
cleanUpSA (op3Namespace );
897
894
}
@@ -1284,4 +1281,15 @@ private void cleanUpDomainSecrets(String domainNamespace) {
1284
1281
}
1285
1282
}
1286
1283
}
1284
+
1285
+ private void uninstallOperatorAndVerify (HelmParams opHelmParams ) {
1286
+ logger .info ("Uninstalling operator" );
1287
+ uninstallOperator (opHelmParams );
1288
+
1289
+ String opNamespace = opHelmParams .getNamespace ();
1290
+ // check the operator pod deleted
1291
+ String operatorPodName = assertDoesNotThrow (() -> getOperatorPodName (OPERATOR_RELEASE_NAME , opNamespace ),
1292
+ "Can't get operator's pod name" );
1293
+ checkPodDoesNotExist (operatorPodName , null , opNamespace );
1294
+ }
1287
1295
}
0 commit comments