@@ -599,29 +599,23 @@ public void testAddRemoveDomainUpdateOperatorHC() throws Exception {
599
599
Map <String , Object > operatorMap = TestUtils .createOperatorMap (number , true );
600
600
Operator operator = new Operator (operatorMap , RESTCertType .SELF_SIGNED );
601
601
operator .callHelmInstall ();
602
- Domain domain = null ;
603
- Domain domainnew = null ;
602
+ Domain domain , domainnew = null ;
604
603
boolean testCompletedSuccessfully = false ;
605
604
try {
606
605
logger .info ("kubectl create namespace test" + (number + 1 ));
607
606
ExecCommand .exec ("kubectl create namespace test" + (number + 1 ));
608
607
domain = createVerifyDomain (number , operator );
609
- logger .info ("update operator with new target domain" );
610
- operator .callHelmUpgrade ("domainNamespaces={test" + number + ",test" + (number + 1 ) + "}" );
611
-
612
608
ArrayList <String > targetDomainsNS =
613
609
(ArrayList <String >) (operator .getOperatorMap ().get ("domainNamespaces" ));
614
610
targetDomainsNS .add ("test" + (number + 1 ));
615
- operatorMap . replace ( "domainNamespaces" , targetDomainsNS );
611
+ upgradeVerifyOperatorDomainNamespaces ( operator , targetDomainsNS );
616
612
domainnew = createVerifyDomain (number + 1 , operator );
617
613
logger .info ("verify that old domain is managed by operator after upgrade" );
618
614
operator .verifyDomainExists (domain .getDomainUid ());
619
615
logger .info ("Upgrade to remove first domain" );
620
- operator .callHelmUpgrade ("domainNamespaces={test" + (number + 1 ) + "}" );
621
- targetDomainsNS = (ArrayList <String >) (operator .getOperatorMap ().get ("domainNamespaces" ));
622
616
targetDomainsNS .remove ("test" + (number ));
623
- operatorMap . replace ( "domainNamespaces" , targetDomainsNS );
624
- Thread .sleep (30 * 1000 );
617
+ upgradeVerifyOperatorDomainNamespaces ( operator , targetDomainsNS );
618
+ Thread .sleep (60 * 1000 );
625
619
logger .info ("verify that old domain is not managed by operator" );
626
620
operator .verifyDomainExists (domain .getDomainUid ());
627
621
throw new RuntimeException (
@@ -658,10 +652,8 @@ public void testDeleteOperatorButNotDomain() throws Exception {
658
652
Assume .assumeFalse (QUICKTEST );
659
653
String testMethodName = new Object () {}.getClass ().getEnclosingMethod ().getName ();
660
654
logTestBegin (testMethodName );
661
-
662
655
logger .info ("Creating Operator & waiting for the script to complete execution" );
663
656
// create operator
664
-
665
657
Operator operator = null ;
666
658
Domain domain = null ;
667
659
boolean testCompletedSuccessfully = false ;
@@ -673,7 +665,7 @@ public void testDeleteOperatorButNotDomain() throws Exception {
673
665
logger .info ("Deleting operator to check that domain functionality is not effected" );
674
666
operator .destroy ();
675
667
operator = null ;
676
- Thread .sleep (20 * 1000 );
668
+ Thread .sleep (60 * 1000 );
677
669
domain .testWlsLivenessProbe ();
678
670
testCompletedSuccessfully = true ;
679
671
} finally {
@@ -699,4 +691,19 @@ private Domain createVerifyDomain(int number, Operator operator) throws Exceptio
699
691
operator .verifyDomainExists (domain .getDomainUid ());
700
692
return domain ;
701
693
}
694
+
695
+ private void upgradeVerifyOperatorDomainNamespaces (
696
+ Operator operator , ArrayList <String > targetNamespaces ) throws Exception {
697
+ logger .info ("update operator with new target domain" );
698
+ String upgradeSet =
699
+ "domainNamespaces="
700
+ + targetNamespaces
701
+ .toString ()
702
+ .replaceAll ("\\ [" , "{" )
703
+ .replaceAll ("\\ ]" , "}" )
704
+ .replaceAll (" " , "" );
705
+ logger .info ("update operator with new target domain " + upgradeSet );
706
+ operator .callHelmUpgrade (upgradeSet );
707
+ operator .getOperatorMap ().replace ("domainNamespaces" , targetNamespaces );
708
+ }
702
709
}
0 commit comments