24
24
25
25
import static oracle .weblogic .kubernetes .TestConstants .ADMIN_PASSWORD_DEFAULT ;
26
26
import static oracle .weblogic .kubernetes .TestConstants .ADMIN_USERNAME_DEFAULT ;
27
+ import static oracle .weblogic .kubernetes .TestConstants .DB_IMAGE_TO_USE_IN_SPEC ;
27
28
import static oracle .weblogic .kubernetes .TestConstants .FMWINFRA_IMAGE_TO_USE_IN_SPEC ;
28
29
import static oracle .weblogic .kubernetes .TestConstants .HTTPS_PROXY ;
29
30
import static oracle .weblogic .kubernetes .TestConstants .HTTP_PROXY ;
30
31
import static oracle .weblogic .kubernetes .TestConstants .K8S_NODEPORT_HOST ;
31
32
import static oracle .weblogic .kubernetes .TestConstants .NO_PROXY ;
33
+ import static oracle .weblogic .kubernetes .TestConstants .OKD ;
32
34
import static oracle .weblogic .kubernetes .TestConstants .RESULTS_TEMPFILE ;
33
35
import static oracle .weblogic .kubernetes .actions .ActionConstants .MODEL_DIR ;
34
36
import static oracle .weblogic .kubernetes .actions .ActionConstants .RESOURCE_DIR ;
40
42
import static oracle .weblogic .kubernetes .utils .DbUtils .createOracleDBUsingOperator ;
41
43
import static oracle .weblogic .kubernetes .utils .DbUtils .createRcuSchema ;
42
44
import static oracle .weblogic .kubernetes .utils .DbUtils .createRcuSecretWithUsernamePassword ;
45
+ import static oracle .weblogic .kubernetes .utils .DbUtils .setupDBandRCUschema ;
43
46
import static oracle .weblogic .kubernetes .utils .DomainUtils .createDomainAndVerify ;
44
47
import static oracle .weblogic .kubernetes .utils .FmwUtils .createDomainResourceOnPv ;
45
48
import static oracle .weblogic .kubernetes .utils .FmwUtils .verifyDomainReady ;
@@ -111,6 +114,11 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
111
114
assertNotNull (namespaces .get (0 ), "Namespace is null" );
112
115
dbNamespace = namespaces .get (0 );
113
116
117
+ final int dbListenerPort = getNextFreePort ();
118
+ ORACLEDBSUFFIX = ".svc.cluster.local:" + dbListenerPort + "/devpdb.k8s" ;
119
+ dbUrl = ORACLEDBURLPREFIX + dbNamespace + ORACLEDBSUFFIX ;
120
+
121
+
114
122
// get a new unique opNamespace
115
123
logger .info ("Assign a unique namespace for operator1" );
116
124
assertNotNull (namespaces .get (1 ), "Namespace is null" );
@@ -123,14 +131,24 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
123
131
124
132
DOMAINHOMEPREFIX = "/shared/" + domainNamespace + "/domains/" ;
125
133
126
- logger .info ("Create Oracle DB in namespace: {0} " , dbNamespace );
127
- createBaseRepoSecret (dbNamespace );
128
- dbUrl = assertDoesNotThrow (() -> createOracleDBUsingOperator (dbName , RCUSYSPASSWORD , dbNamespace ));
129
-
130
- logger .info ("Create RCU schema with fmwImage: {0}, rcuSchemaPrefix: {1}, dbUrl: {2}, "
131
- + " dbNamespace: {3}" , FMWINFRA_IMAGE_TO_USE_IN_SPEC , RCUSCHEMAPREFIX , dbUrl , dbNamespace );
132
- assertDoesNotThrow (() -> createRcuSchema (FMWINFRA_IMAGE_TO_USE_IN_SPEC , RCUSCHEMAPREFIX ,
133
- dbUrl , dbNamespace ));
134
+ if (OKD ) {
135
+ logger .info ("Start DB and create RCU schema for namespace: {0}, dbListenerPort: {1}, RCU prefix: {2}, "
136
+ + "dbUrl: {3}, dbImage: {4}, fmwImage: {5} " , dbNamespace , dbListenerPort , RCUSCHEMAPREFIX , dbUrl ,
137
+ DB_IMAGE_TO_USE_IN_SPEC , FMWINFRA_IMAGE_TO_USE_IN_SPEC );
138
+ assertDoesNotThrow (() -> setupDBandRCUschema (DB_IMAGE_TO_USE_IN_SPEC , FMWINFRA_IMAGE_TO_USE_IN_SPEC ,
139
+ RCUSCHEMAPREFIX , dbNamespace , getNextFreePort (), dbUrl , dbListenerPort ),
140
+ String .format ("Failed to create RCU schema for prefix %s in the namespace %s with "
141
+ + "dbUrl %s, dbListenerPost %s" , RCUSCHEMAPREFIX , dbNamespace , dbUrl , dbListenerPort ));
142
+ } else {
143
+ logger .info ("Create Oracle DB in namespace: {0} " , dbNamespace );
144
+ createBaseRepoSecret (dbNamespace );
145
+ dbUrl = assertDoesNotThrow (() -> createOracleDBUsingOperator (dbName , RCUSYSPASSWORD , dbNamespace ));
146
+
147
+ logger .info ("Create RCU schema with fmwImage: {0}, rcuSchemaPrefix: {1}, dbUrl: {2}, "
148
+ + " dbNamespace: {3}" , FMWINFRA_IMAGE_TO_USE_IN_SPEC , RCUSCHEMAPREFIX , dbUrl , dbNamespace );
149
+ assertDoesNotThrow (() -> createRcuSchema (FMWINFRA_IMAGE_TO_USE_IN_SPEC , RCUSCHEMAPREFIX ,
150
+ dbUrl , dbNamespace ));
151
+ }
134
152
135
153
// install operator and verify its running in ready state
136
154
installAndVerifyOperator (opNamespace , domainNamespace );
0 commit comments