2727import oracle .weblogic .kubernetes .annotations .IntegrationTest ;
2828import oracle .weblogic .kubernetes .annotations .Namespaces ;
2929import oracle .weblogic .kubernetes .logging .LoggingFacade ;
30- import oracle .weblogic .kubernetes .utils .ExecResult ;
3130import org .awaitility .core .ConditionFactory ;
3231import org .junit .jupiter .api .BeforeAll ;
3332import org .junit .jupiter .api .DisplayName ;
7271import static oracle .weblogic .kubernetes .utils .DomainUtils .deleteDomainResource ;
7372import static oracle .weblogic .kubernetes .utils .FmwUtils .createDomainResourceSimplifyJrfPv ;
7473import static oracle .weblogic .kubernetes .utils .FmwUtils .createSimplifyJrfPvDomainAndRCU ;
75- import static oracle .weblogic .kubernetes .utils .FmwUtils .restoreOpssWalletfileSecret ;
7674import static oracle .weblogic .kubernetes .utils .FmwUtils .saveAndRestoreOpssWalletfileSecret ;
7775import static oracle .weblogic .kubernetes .utils .FmwUtils .verifyDomainReady ;
7876import static oracle .weblogic .kubernetes .utils .ImageUtils .createBaseRepoSecret ;
8482import static oracle .weblogic .kubernetes .utils .PodUtils .checkPodExists ;
8583import static oracle .weblogic .kubernetes .utils .PodUtils .checkPodLogContains ;
8684import static oracle .weblogic .kubernetes .utils .PodUtils .getExternalServicePodName ;
87- import static oracle .weblogic .kubernetes .utils .SecretUtils .createOpsswalletFileSecretWithoutFile ;
8885import static oracle .weblogic .kubernetes .utils .SecretUtils .createOpsswalletpasswordSecret ;
8986import static oracle .weblogic .kubernetes .utils .SecretUtils .createSecretWithUsernamePassword ;
9087import static oracle .weblogic .kubernetes .utils .ThreadSafeLogger .getLogger ;
10198@ DisplayName ("Test for initializeDomainOnPV when user per-creates RCU" )
10299@ IntegrationTest
103100@ Tag ("kind-sequential" )
101+ @ Tag ("oke-gate" )
104102public class ItFmwDomainInPvUserCreateRcu {
105103
106104 private static String opNamespace = null ;
@@ -118,6 +116,7 @@ public class ItFmwDomainInPvUserCreateRcu {
118116 private static final String domainUid1 = "jrfdomainonpv-userrcu1" ;
119117 private static final String domainUid3 = "jrfdomainonpv-userrcu3" ;
120118 private static final String domainUid4 = "jrfdomainonpv-userrcu4" ;
119+
121120 private static final String miiAuxiliaryImage1Tag = "jrf1" + MII_BASIC_IMAGE_TAG ;
122121 private final String adminSecretName1 = domainUid1 + "-weblogic-credentials" ;
123122 private final String adminSecretName3 = domainUid3 + "-weblogic-credentials" ;
@@ -285,9 +284,9 @@ void testFmwDomainOnPvUserProvideOpss() {
285284 logger .info ("Deleting domain custom resource with namespace: {0}, domainUid {1}" , domainNamespace , domainUid1 );
286285 deleteDomainResource (domainNamespace , domainUid1 );
287286 try {
288- deleteDirectory (Paths .get ("/share " ).toFile ());
287+ deleteDirectory (Paths .get ("/shared " ).toFile ());
289288 } catch (IOException ioe ) {
290- logger .severe ("Failed to cleanup directory /share " , ioe );
289+ logger .severe ("Failed to cleanup directory /shared " , ioe );
291290 }
292291 logger .info ("Creating domain custom resource with pvName: {0}" , pvName );
293292 DomainResource domain = createDomainResourceSimplifyJrfPv (
@@ -497,85 +496,13 @@ void testFmwDomainOnPvUserCreatesRCUwdtConfigMap() {
497496
498497 }
499498
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- }
572499
573500 /**
574501 * User creates RCU, Operate creates PV/PVC and FMW domain with multiple images
575502 * Verify Pod is ready and service exists for both admin server and managed servers.
576503 */
577504 @ Test
578- @ Order (6 )
505+ @ Order (5 )
579506 @ DisplayName ("Create a FMW domain on PV with multiple images when user per-creates RCU" )
580507 void testFmwDomainOnPvUserCreatesRCUMultiImages () {
581508
@@ -623,7 +550,7 @@ void testFmwDomainOnPvUserCreatesRCUMultiImages() {
623550 DomainCreationImage domainCreationImage1 = createImage (fmwModelFile ,fmwModelPropFile ,"jrf3" );
624551
625552 // image2 with model files for jms config
626- List modelList = new ArrayList <>();
553+ List < String > modelList = new ArrayList <>();
627554 modelList .add (MODEL_DIR + "/model.jms2.yaml" );
628555 String miiAuxiliaryImageTag = "jrf3jms" + MII_BASIC_IMAGE_TAG ;
629556 WitParams witParams =
@@ -670,7 +597,7 @@ void testFmwDomainOnPvUserCreatesRCUMultiImages() {
670597 * Verify Pod is ready and service exists for both admin server and managed servers.
671598 */
672599 @ Test
673- @ Order (7 )
600+ @ Order (6 )
674601 @ DisplayName ("Create a FMW domain on PV with provided OPSS wallet file secret" )
675602 void testFmwDomainOnPVwithProvidedOpss () {
676603
@@ -681,9 +608,9 @@ void testFmwDomainOnPVwithProvidedOpss() {
681608 logger .info ("Deleting domain custom resource with namespace: {0}, domainUid {1}" , domainNamespace , domainUid3 );
682609 deleteDomainResource (domainNamespace , domainUid3 );
683610 try {
684- deleteDirectory (Paths .get ("/share " ).toFile ());
611+ deleteDirectory (Paths .get ("/shared " ).toFile ());
685612 } catch (IOException ioe ) {
686- logger .severe ("Failed to cleanup directory /share " , ioe );
613+ logger .severe ("Failed to cleanup directory /shared " , ioe );
687614 }
688615 logger .info ("Creating domain custom resource with pvName: {0}" , pvName );
689616 DomainResource domain = createSimplifyJrfPvDomainAndRCU (
@@ -719,7 +646,7 @@ void testFmwDomainOnPVwithProvidedOpss() {
719646 * Verify Operator starts the servers in the new cluster.
720647 */
721648 @ Test
722- @ Order (8 )
649+ @ Order (7 )
723650 @ DisplayName ("Create a FMW domain on PV with adding new cluster" )
724651 void testFmwDomainOnPvUserWithAddedCluster () {
725652 String domainUid = "jrfdomainonpv-userrcu7" ;
0 commit comments