28
28
29
29
import static oracle .weblogic .kubernetes .TestConstants .ADMIN_PASSWORD_DEFAULT ;
30
30
import static oracle .weblogic .kubernetes .TestConstants .ADMIN_USERNAME_DEFAULT ;
31
- import static oracle .weblogic .kubernetes .TestConstants .DB_IMAGE_TO_USE_IN_SPEC ;
32
31
import static oracle .weblogic .kubernetes .TestConstants .DOMAIN_API_VERSION ;
33
32
import static oracle .weblogic .kubernetes .TestConstants .FMWINFRA_IMAGE_NAME ;
34
33
import static oracle .weblogic .kubernetes .TestConstants .FMWINFRA_IMAGE_TAG ;
38
37
import static oracle .weblogic .kubernetes .TestConstants .OKE_CLUSTER ;
39
38
import static oracle .weblogic .kubernetes .TestConstants .TEST_IMAGES_REPO_SECRET_NAME ;
40
39
import static oracle .weblogic .kubernetes .actions .ActionConstants .MODEL_DIR ;
40
+ import static oracle .weblogic .kubernetes .utils .CommonTestUtils .createIngressHostRouting ;
41
41
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getNextFreePort ;
42
42
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .isAppInServerPodReady ;
43
43
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .testUntil ;
44
+ import static oracle .weblogic .kubernetes .utils .DbUtils .createOracleDBUsingOperator ;
44
45
import static oracle .weblogic .kubernetes .utils .DbUtils .createRcuAccessSecret ;
45
- import static oracle .weblogic .kubernetes .utils .DbUtils .setupDBandRCUschema ;
46
+ import static oracle .weblogic .kubernetes .utils .DbUtils .createRcuSchema ;
47
+ import static oracle .weblogic .kubernetes .utils .DbUtils .installDBOperator ;
46
48
import static oracle .weblogic .kubernetes .utils .DomainUtils .createDomainAndVerify ;
47
49
import static oracle .weblogic .kubernetes .utils .FmwUtils .verifyDomainReady ;
48
50
import static oracle .weblogic .kubernetes .utils .FmwUtils .verifyEMconsoleAccess ;
@@ -77,13 +79,14 @@ class ItFmwDynamicClusterMiiDomain {
77
79
private static final String RCUSCHEMAPREFIX = "jrfdomainmii" ;
78
80
private static final String ORACLEDBURLPREFIX = "oracledb." ;
79
81
private static String ORACLEDBSUFFIX = null ;
82
+ private static final String RCUSYSPASSWORD = "Oradoc_db1" ;
80
83
private static final String RCUSCHEMAPASSWORD = "Oradoc_db1" ;
81
84
private static final String modelFile = "model-fmw-dynamicdomain.yaml" ;
82
85
83
86
private static String dbUrl = null ;
84
87
private static LoggingFacade logger = null ;
88
+ private static String domainUid = "jrf-dynamicdomain-mii" ;
85
89
86
- private String domainUid = "jrf-dynamicdomain-mii" ;
87
90
private String adminServerPodName = domainUid + "-admin-server" ;
88
91
private String managedServerPrefix = domainUid + "-managed-server" ;
89
92
private String adminSecretName = domainUid + "-weblogic-credentials" ;
@@ -92,6 +95,10 @@ class ItFmwDynamicClusterMiiDomain {
92
95
private String opsswalletpassSecretName = domainUid + "-opss-wallet-password-secret" ;
93
96
private int replicaCount = 1 ;
94
97
private String adminSvcExtHost = null ;
98
+ private static String dbName = domainUid + "my-oracle-db" ;
99
+ private static String hostHeader ;
100
+ private static int adminPort = 7001 ;
101
+ private static final String adminServerName = "admin-server" ;
95
102
96
103
/**
97
104
* Start DB service and create RCU schema.
@@ -108,9 +115,6 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
108
115
logger .info ("Assign a unique namespace for DB and RCU" );
109
116
assertNotNull (namespaces .get (0 ), "Namespace is null" );
110
117
dbNamespace = namespaces .get (0 );
111
- final int dbListenerPort = getNextFreePort ();
112
- ORACLEDBSUFFIX = ".svc.cluster.local:" + dbListenerPort + "/devpdb.k8s" ;
113
- dbUrl = ORACLEDBURLPREFIX + dbNamespace + ORACLEDBSUFFIX ;
114
118
115
119
logger .info ("Assign a unique namespace for operator" );
116
120
assertNotNull (namespaces .get (1 ), "Namespace is null" );
@@ -120,16 +124,16 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
120
124
assertNotNull (namespaces .get (2 ), "Namespace is null" );
121
125
domainNamespace = namespaces .get (2 );
122
126
123
- logger .info ("Start DB and create RCU schema for namespace: {0}, dbListenerPort: {1}, RCU prefix: {2}, "
124
- + "dbUrl: {3}, dbImage: {4}, fmwImage: {5} " , dbNamespace , dbListenerPort , RCUSCHEMAPREFIX , dbUrl ,
125
- DB_IMAGE_TO_USE_IN_SPEC , FMWINFRA_IMAGE_TO_USE_IN_SPEC );
126
- assertDoesNotThrow (() -> setupDBandRCUschema (DB_IMAGE_TO_USE_IN_SPEC , FMWINFRA_IMAGE_TO_USE_IN_SPEC ,
127
- RCUSCHEMAPREFIX , dbNamespace , getNextFreePort (), dbUrl , dbListenerPort ),
128
- String .format ("Failed to create RCU schema for prefix %s in the namespace %s with "
129
- + "dbUrl %s, dbListenerPost %s" , RCUSCHEMAPREFIX , dbNamespace , dbUrl , dbListenerPort ));
127
+ //install Oracle Database Operator
128
+ assertDoesNotThrow (() -> installDBOperator (dbNamespace ), "Failed to install database operator" );
130
129
131
- logger .info ("DB image: {0}, FMW image {1} used in the test" ,
132
- DB_IMAGE_TO_USE_IN_SPEC , FMWINFRA_IMAGE_TO_USE_IN_SPEC );
130
+ logger .info ("Create Oracle DB in namespace: {0} " , dbNamespace );
131
+ dbUrl = assertDoesNotThrow (() -> createOracleDBUsingOperator (dbName , RCUSYSPASSWORD , dbNamespace ));
132
+
133
+ logger .info ("Create RCU schema with fmwImage: {0}, rcuSchemaPrefix: {1}, dbUrl: {2}, "
134
+ + " dbNamespace: {3}" , FMWINFRA_IMAGE_TO_USE_IN_SPEC , RCUSCHEMAPREFIX , dbUrl , dbNamespace );
135
+ assertDoesNotThrow (() -> createRcuSchema (FMWINFRA_IMAGE_TO_USE_IN_SPEC , RCUSCHEMAPREFIX ,
136
+ dbUrl , dbNamespace ));
133
137
134
138
// install operator and verify its running in ready state
135
139
installAndVerifyOperator (opNamespace , domainNamespace );
@@ -157,7 +161,13 @@ void testFmwDynamicClusterDomainInModelInImage() {
157
161
} else {
158
162
// Expose the admin service external node port as a route for OKD
159
163
adminSvcExtHost = createRouteForOKD (getExternalServicePodName (adminServerPodName ), domainNamespace );
160
- verifyEMconsoleAccess (domainNamespace , domainUid , adminSvcExtHost );
164
+ if (TestConstants .KIND_CLUSTER
165
+ && !TestConstants .WLSIMG_BUILDER .equals (TestConstants .WLSIMG_BUILDER_DEFAULT )) {
166
+ hostHeader = createIngressHostRouting (domainNamespace , domainUid , adminServerName , adminPort );
167
+ verifyEMconsoleAccess (domainNamespace , domainUid , adminSvcExtHost , hostHeader );
168
+ } else {
169
+ verifyEMconsoleAccess (domainNamespace , domainUid , adminSvcExtHost );
170
+ }
161
171
}
162
172
}
163
173
0 commit comments