27
27
import oracle .weblogic .kubernetes .annotations .IntegrationTest ;
28
28
import oracle .weblogic .kubernetes .annotations .Namespaces ;
29
29
import oracle .weblogic .kubernetes .logging .LoggingFacade ;
30
- import oracle .weblogic .kubernetes .utils .ExecResult ;
31
30
import org .awaitility .core .ConditionFactory ;
32
31
import org .junit .jupiter .api .BeforeAll ;
33
32
import org .junit .jupiter .api .DisplayName ;
72
71
import static oracle .weblogic .kubernetes .utils .DomainUtils .deleteDomainResource ;
73
72
import static oracle .weblogic .kubernetes .utils .FmwUtils .createDomainResourceSimplifyJrfPv ;
74
73
import static oracle .weblogic .kubernetes .utils .FmwUtils .createSimplifyJrfPvDomainAndRCU ;
75
- import static oracle .weblogic .kubernetes .utils .FmwUtils .restoreOpssWalletfileSecret ;
76
74
import static oracle .weblogic .kubernetes .utils .FmwUtils .saveAndRestoreOpssWalletfileSecret ;
77
75
import static oracle .weblogic .kubernetes .utils .FmwUtils .verifyDomainReady ;
78
76
import static oracle .weblogic .kubernetes .utils .ImageUtils .createBaseRepoSecret ;
84
82
import static oracle .weblogic .kubernetes .utils .PodUtils .checkPodExists ;
85
83
import static oracle .weblogic .kubernetes .utils .PodUtils .checkPodLogContains ;
86
84
import static oracle .weblogic .kubernetes .utils .PodUtils .getExternalServicePodName ;
87
- import static oracle .weblogic .kubernetes .utils .SecretUtils .createOpsswalletFileSecretWithoutFile ;
88
85
import static oracle .weblogic .kubernetes .utils .SecretUtils .createOpsswalletpasswordSecret ;
89
86
import static oracle .weblogic .kubernetes .utils .SecretUtils .createSecretWithUsernamePassword ;
90
87
import static oracle .weblogic .kubernetes .utils .ThreadSafeLogger .getLogger ;
101
98
@ DisplayName ("Test for initializeDomainOnPV when user per-creates RCU" )
102
99
@ IntegrationTest
103
100
@ Tag ("kind-sequential" )
101
+ @ Tag ("oke-gate" )
104
102
public class ItFmwDomainInPvUserCreateRcu {
105
103
106
104
private static String opNamespace = null ;
@@ -118,6 +116,7 @@ public class ItFmwDomainInPvUserCreateRcu {
118
116
private static final String domainUid1 = "jrfdomainonpv-userrcu1" ;
119
117
private static final String domainUid3 = "jrfdomainonpv-userrcu3" ;
120
118
private static final String domainUid4 = "jrfdomainonpv-userrcu4" ;
119
+
121
120
private static final String miiAuxiliaryImage1Tag = "jrf1" + MII_BASIC_IMAGE_TAG ;
122
121
private final String adminSecretName1 = domainUid1 + "-weblogic-credentials" ;
123
122
private final String adminSecretName3 = domainUid3 + "-weblogic-credentials" ;
@@ -285,9 +284,9 @@ void testFmwDomainOnPvUserProvideOpss() {
285
284
logger .info ("Deleting domain custom resource with namespace: {0}, domainUid {1}" , domainNamespace , domainUid1 );
286
285
deleteDomainResource (domainNamespace , domainUid1 );
287
286
try {
288
- deleteDirectory (Paths .get ("/share " ).toFile ());
287
+ deleteDirectory (Paths .get ("/shared " ).toFile ());
289
288
} catch (IOException ioe ) {
290
- logger .severe ("Failed to cleanup directory /share " , ioe );
289
+ logger .severe ("Failed to cleanup directory /shared " , ioe );
291
290
}
292
291
logger .info ("Creating domain custom resource with pvName: {0}" , pvName );
293
292
DomainResource domain = createDomainResourceSimplifyJrfPv (
@@ -497,85 +496,13 @@ void testFmwDomainOnPvUserCreatesRCUwdtConfigMap() {
497
496
498
497
}
499
498
500
- /**
501
- * The user provides opss.walletFileSecret that is empty.
502
- * If "ewallet.p12" is an empty file, running opss-wallet.sh to restore the wallet file
503
- * secret will fail and return "Error: Wallet file 'ewallet.p12' is empty"
504
- * Create opss.walletFileSecret without entry with --from-file=walletFile to get an empty walletFileSecret
505
- * The operator will not mount the secret but proceed with normal domain creation without error
506
- */
507
- @ Test
508
- @ Order (5 )
509
- @ DisplayName ("Create a FMW domain on PV when user provide OPSS wallet file is empty" )
510
- void testFmwDomainOnPvUserProvideEmptyOpss () {
511
-
512
- final String pvName = getUniqueName (domainUid4 + "-pv-" );
513
- final String pvcName = getUniqueName (domainUid4 + "-pvc-" );
514
-
515
- //create empty wallet file ewallet.p12
516
- try {
517
- File file = new File ("ewallet.p12" );
518
- if (file .createNewFile ()) {
519
- logger .info ("Empty wallet file ewallet.p12 is created: " + file .getAbsolutePath ());
520
- } else {
521
- logger .info ("Failed to create file ewallet.p12 " );
522
- }
523
- } catch (IOException ioe ) {
524
- logger .severe ("Failed to create file ewallet.p12" , ioe );
525
- }
526
-
527
- ExecResult result = restoreOpssWalletfileSecret (domainNamespace , domainUid4 , opsswalletfileSecretName4 );
528
- logger .info ("restoreOpssWalletfileSecret returns msg: " + result .stdout ());
529
- assertTrue (result .stdout ().contains ("Error: Wallet file 'ewallet.p12' is empty" ));
530
-
531
- //delete the empty wallet file ewallet.p12
532
- try {
533
- delete (new File ("./ewallet.p12" ));
534
- logger .info ("Wallet file ewallet.p12 is deleted" );
535
- } catch (IOException ioe ) {
536
- logger .severe ("Failed to delete file ewallet.p12" , ioe );
537
- }
538
-
539
- //create empty walletFileSecret
540
- createOpsswalletFileSecretWithoutFile (opsswalletfileSecretName4 , domainNamespace );
541
- logger .info ("Empty walletFile secret {0} is created in the namespace {1}" ,
542
- opsswalletfileSecretName4 , domainNamespace );
543
-
544
- logger .info ("Deleting domain custom resource with namespace: {0}, domainUid {1}" , domainNamespace , domainUid4 );
545
- deleteDomainResource (domainNamespace , domainUid4 );
546
- try {
547
- deleteDirectory (Paths .get ("/share" ).toFile ());
548
- } catch (IOException ioe ) {
549
- logger .severe ("Failed to cleanup directory /share" , ioe );
550
- }
551
- logger .info ("Creating domain custom resource with pvName: {0}" , pvName );
552
- DomainResource domain = createDomainResourceSimplifyJrfPv (
553
- domainUid4 , domainNamespace , adminSecretName4 ,
554
- TEST_IMAGES_REPO_SECRET_NAME ,
555
- rcuaccessSecretName4 ,
556
- opsswalletpassSecretName4 , opsswalletfileSecretName4 ,
557
- pvName , pvcName , domainCreationImages4 , configMapName );
558
-
559
- createDomainAndVerify (domain , domainNamespace );
560
-
561
- // verify that all servers are ready
562
- verifyDomainReady (domainNamespace , domainUid4 , replicaCount , "nosuffix" );
563
-
564
- // delete the domain
565
- deleteDomainResource (domainNamespace , domainUid4 );
566
- //delete the rcu pod
567
- assertDoesNotThrow (() -> deletePod ("rcu" , dbNamespace ),
568
- "Got exception while deleting server " + "rcu" );
569
- checkPodDoesNotExist ("rcu" , null , dbNamespace );
570
-
571
- }
572
499
573
500
/**
574
501
* User creates RCU, Operate creates PV/PVC and FMW domain with multiple images
575
502
* Verify Pod is ready and service exists for both admin server and managed servers.
576
503
*/
577
504
@ Test
578
- @ Order (6 )
505
+ @ Order (5 )
579
506
@ DisplayName ("Create a FMW domain on PV with multiple images when user per-creates RCU" )
580
507
void testFmwDomainOnPvUserCreatesRCUMultiImages () {
581
508
@@ -623,7 +550,7 @@ void testFmwDomainOnPvUserCreatesRCUMultiImages() {
623
550
DomainCreationImage domainCreationImage1 = createImage (fmwModelFile ,fmwModelPropFile ,"jrf3" );
624
551
625
552
// image2 with model files for jms config
626
- List modelList = new ArrayList <>();
553
+ List < String > modelList = new ArrayList <>();
627
554
modelList .add (MODEL_DIR + "/model.jms2.yaml" );
628
555
String miiAuxiliaryImageTag = "jrf3jms" + MII_BASIC_IMAGE_TAG ;
629
556
WitParams witParams =
@@ -670,7 +597,7 @@ void testFmwDomainOnPvUserCreatesRCUMultiImages() {
670
597
* Verify Pod is ready and service exists for both admin server and managed servers.
671
598
*/
672
599
@ Test
673
- @ Order (7 )
600
+ @ Order (6 )
674
601
@ DisplayName ("Create a FMW domain on PV with provided OPSS wallet file secret" )
675
602
void testFmwDomainOnPVwithProvidedOpss () {
676
603
@@ -681,9 +608,9 @@ void testFmwDomainOnPVwithProvidedOpss() {
681
608
logger .info ("Deleting domain custom resource with namespace: {0}, domainUid {1}" , domainNamespace , domainUid3 );
682
609
deleteDomainResource (domainNamespace , domainUid3 );
683
610
try {
684
- deleteDirectory (Paths .get ("/share " ).toFile ());
611
+ deleteDirectory (Paths .get ("/shared " ).toFile ());
685
612
} catch (IOException ioe ) {
686
- logger .severe ("Failed to cleanup directory /share " , ioe );
613
+ logger .severe ("Failed to cleanup directory /shared " , ioe );
687
614
}
688
615
logger .info ("Creating domain custom resource with pvName: {0}" , pvName );
689
616
DomainResource domain = createSimplifyJrfPvDomainAndRCU (
@@ -719,7 +646,7 @@ void testFmwDomainOnPVwithProvidedOpss() {
719
646
* Verify Operator starts the servers in the new cluster.
720
647
*/
721
648
@ Test
722
- @ Order (8 )
649
+ @ Order (7 )
723
650
@ DisplayName ("Create a FMW domain on PV with adding new cluster" )
724
651
void testFmwDomainOnPvUserWithAddedCluster () {
725
652
String domainUid = "jrfdomainonpv-userrcu7" ;
0 commit comments