Skip to content

Commit 7d8e141

Browse files
authored
make the domain path unique across domains (#3057)
wait until remotr console access returns 200 status code
1 parent 48a0e9e commit 7d8e141

File tree

10 files changed

+42
-32
lines changed

10 files changed

+42
-32
lines changed

integration-tests/pom.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@
457457
**/ItIntrospectVersion,
458458
**/ItLiftAndShiftFromOnPremDomain,
459459
**/ItLivenessProbeCustomization,
460-
**/ItManageNameSpace,
461460
**/ItManagedCoherence,
462461
**/ItMiiDynamicUpdate*,
463462
**/ItMiiCustomSslStore,
@@ -476,8 +475,7 @@
476475
**/ItSystemResOverrides,
477476
**/ItMonitoringExporterWebApp,
478477
**/ItMonitoringExporterSideCar,
479-
**/ItMonitoringExporterSamples,
480-
**/ItUsabilityOperatorHelmChart
478+
**/ItMonitoringExporterSamples
481479
</includes-failsafe>
482480
</properties>
483481
</profile>
@@ -520,7 +518,6 @@
520518
**/ItIntrospectVersion,
521519
**/ItLiftAndShiftFromOnPremDomain,
522520
**/ItLivenessProbeCustomization,
523-
**/ItManageNameSpace,
524521
**/ItManagedCoherence,
525522
**/ItMiiDynamicUpdate*,
526523
**/ItMiiCustomSslStore,
@@ -539,8 +536,7 @@
539536
**/ItSystemResOverrides,
540537
**/ItMonitoringExporterWebApp,
541538
**/ItMonitoringExporterSideCar,
542-
**/ItMonitoringExporterSamples,
543-
**/ItUsabilityOperatorHelmChart
539+
**/ItMonitoringExporterSamples
544540
</includes-failsafe>
545541
</properties>
546542
</profile>

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItConfigDistributionStrategy.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,8 @@ private void verifyIntrospectorRuns() {
825825

826826
//create a standard WebLogic domain.
827827
private void createDomain() {
828+
829+
String uniquePath = "/shared/" + domainNamespace + "/domains";
828830

829831
// create WebLogic domain credential secret
830832
createSecretWithUsernamePassword(wlSecretName, domainNamespace,
@@ -840,7 +842,7 @@ private void createDomain() {
840842
-> File.createTempFile("domain", ".properties"),
841843
"Failed to create domain properties file");
842844
Properties p = new Properties();
843-
p.setProperty("domain_path", "/shared/domains");
845+
p.setProperty("domain_path", uniquePath);
844846
p.setProperty("domain_name", domainUid);
845847
p.setProperty("cluster_name", clusterName);
846848
p.setProperty("admin_server_name", adminServerName);
@@ -852,7 +854,7 @@ private void createDomain() {
852854
p.setProperty("admin_t3_channel_port", Integer.toString(t3ChannelPort));
853855
p.setProperty("number_of_ms", "2");
854856
p.setProperty("managed_server_name_base", managedServerNameBase);
855-
p.setProperty("domain_logs", "/shared/logs");
857+
p.setProperty("domain_logs", uniquePath + "/logs");
856858
p.setProperty("production_mode_enabled", "true");
857859
assertDoesNotThrow(()
858860
-> p.store(new FileOutputStream(domainPropertiesFile), "domain properties file"),
@@ -878,7 +880,7 @@ private void createDomain() {
878880
.overrideDistributionStrategy("DYNAMIC")
879881
.introspectorJobActiveDeadlineSeconds(300L))
880882
.domainUid(domainUid)
881-
.domainHome("/shared/domains/" + domainUid) // point to domain home in pv
883+
.domainHome(uniquePath + "/" + domainUid) // point to domain home in pv
882884
.domainHomeSourceType("PersistentVolume") // set the domain home source type as pv
883885
.image(WEBLOGIC_IMAGE_TO_USE_IN_SPEC)
884886
.imagePullPolicy("IfNotPresent")
@@ -890,7 +892,7 @@ private void createDomain() {
890892
.namespace(domainNamespace))
891893
.includeServerOutInPodLog(true)
892894
.logHomeEnabled(Boolean.TRUE)
893-
.logHome("/shared/logs/" + domainUid)
895+
.logHome(uniquePath + "/logs/" + domainUid)
894896
.dataHome("")
895897
.serverStartPolicy("IF_NEEDED")
896898
.serverPod(new ServerPod() //serverpod

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPVUsingWDT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class ItFmwDomainInPVUsingWDT {
7979
private static final String RCUSCHEMAUSERNAME = "myrcuuser";
8080
private static final String RCUSCHEMAPASSWORD = "Oradoc_db1";
8181

82-
private static final String DOMAINHOMEPREFIX = "/shared/domains/";
82+
private static final String DOMAINHOMEPREFIX = "/shared/" + domainNamespace + "/domains/";
8383

8484
private static String dbUrl = null;
8585
private static LoggingFacade logger = null;

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPVUsingWLST.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,11 @@ void testFmwDomainInPvUsingWlst() {
195195
java_home = getImageEnvVar(FMWINFRA_IMAGE_TO_USE_IN_SPEC, "JAVA_HOME");
196196
logger.info("JAVA_HOME in image {0} is: {1}", FMWINFRA_IMAGE_TO_USE_IN_SPEC, java_home);
197197

198+
String uniquePath = "/shared/" + jrfDomainNamespace + "/domains/";
198199
Properties p = new Properties();
199200
p.setProperty("oracleHome", oracle_home); //default $ORACLE_HOME
200201
p.setProperty("javaHome", java_home); //default $JAVA_HOME
201-
p.setProperty("domainParentDir", "/shared/domains/");
202+
p.setProperty("domainParentDir", uniquePath);
202203
p.setProperty("domainName", domainUid);
203204
p.setProperty("domainUser", ADMIN_USERNAME_DEFAULT);
204205
p.setProperty("domainPassword", ADMIN_PASSWORD_DEFAULT);
@@ -237,7 +238,7 @@ void testFmwDomainInPvUsingWlst() {
237238
.namespace(jrfDomainNamespace))
238239
.spec(new DomainSpec()
239240
.domainUid(domainUid)
240-
.domainHome("/shared/domains/" + domainUid) // point to domain home in pv
241+
.domainHome(uniquePath + domainUid) // point to domain home in pv
241242
.domainHomeSourceType("PersistentVolume") // set the domain home source type as pv
242243
.image(FMWINFRA_IMAGE_TO_USE_IN_SPEC)
243244
.imagePullPolicy("IfNotPresent")
@@ -249,7 +250,7 @@ void testFmwDomainInPvUsingWlst() {
249250
.namespace(jrfDomainNamespace))
250251
.includeServerOutInPodLog(true)
251252
.logHomeEnabled(Boolean.TRUE)
252-
.logHome("/shared/logs/" + domainUid)
253+
.logHome(uniquePath + "logs/" + domainUid)
253254
.dataHome("")
254255
.serverStartPolicy("IF_NEEDED")
255256
.serverPod(new ServerPod() //serverpod
@@ -350,5 +351,4 @@ private void createDomainOnPVUsingWlst(Path wlstScriptFile, Path domainPropertie
350351

351352
}
352353

353-
}
354-
354+
}

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIntrospectVersion.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,7 @@ void testIntrospectDomainScript() {
969969
}
970970

971971
private static void createDomain() {
972+
String uniquePath = "/shared/" + introDomainNamespace + "/domains";
972973

973974
// create WebLogic domain credential secret
974975
createSecretWithUsernamePassword(wlSecretName, introDomainNamespace,
@@ -981,7 +982,7 @@ private static void createDomain() {
981982
File.createTempFile("domain", "properties"),
982983
"Failed to create domain properties file");
983984
Properties p = new Properties();
984-
p.setProperty("domain_path", "/shared/domains");
985+
p.setProperty("domain_path", uniquePath);
985986
p.setProperty("domain_name", domainUid);
986987
p.setProperty("cluster_name", cluster1Name);
987988
p.setProperty("admin_server_name", adminServerName);
@@ -993,7 +994,7 @@ private static void createDomain() {
993994
p.setProperty("admin_t3_channel_port", Integer.toString(t3ChannelPort));
994995
p.setProperty("number_of_ms", "2"); // maximum number of servers in cluster
995996
p.setProperty("managed_server_name_base", cluster1ManagedServerNameBase);
996-
p.setProperty("domain_logs", "/shared/logs");
997+
p.setProperty("domain_logs", uniquePath + "/logs");
997998
p.setProperty("production_mode_enabled", "true");
998999
assertDoesNotThrow(() ->
9991000
p.store(new FileOutputStream(domainPropertiesFile), "domain properties file"),
@@ -1016,7 +1017,7 @@ private static void createDomain() {
10161017
.namespace(introDomainNamespace))
10171018
.spec(new DomainSpec()
10181019
.domainUid(domainUid)
1019-
.domainHome("/shared/domains/" + domainUid) // point to domain home in pv
1020+
.domainHome(uniquePath + "/" + domainUid) // point to domain home in pv
10201021
.domainHomeSourceType("PersistentVolume") // set the domain home source type as pv
10211022
.image(WEBLOGIC_IMAGE_TO_USE_IN_SPEC)
10221023
.imagePullPolicy("IfNotPresent")
@@ -1025,7 +1026,7 @@ private static void createDomain() {
10251026
.namespace(introDomainNamespace))
10261027
.includeServerOutInPodLog(true)
10271028
.logHomeEnabled(Boolean.TRUE)
1028-
.logHome("/shared/logs/" + domainUid)
1029+
.logHome(uniquePath + "/logs/" + domainUid)
10291030
.dataHome("")
10301031
.serverStartPolicy("IF_NEEDED")
10311032
.serverPod(new ServerPod() //serverpod

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItKubernetesDomainEvents.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ void testLogHomeChangeEvents() {
546546
Map<String, OffsetDateTime> podsWithTimeStamps = getPodsWithTimeStamps(domainNamespace3,
547547
adminServerPodName, managedServerPodNamePrefix, replicaCount);
548548

549-
String newLogHome = "/shared/" + domainNamespace3 + "/domains/logHome";
549+
String newLogHome = "/shared/" + domainNamespace3 + "/domains/logHome/" + domainUid;
550550
//print out the original image name
551551
String logHome = domain1.getSpec().getLogHome();
552552
logger.info("Changing the current log home used by the domain : {0} to {1}", logHome, newLogHome);

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSystemResOverrides.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ private void verifyIntrospectorRuns() {
306306
}
307307

308308
//create a standard WebLogic domain.
309-
private void createDomain() {
309+
private void createDomain() {
310+
String uniquePath = "/shared/" + domainNamespace + "/domains";
310311

311312
// create WebLogic domain credential secret
312313
createSecretWithUsernamePassword(wlSecretName, domainNamespace,
@@ -322,7 +323,7 @@ private void createDomain() {
322323
-> File.createTempFile("domain", ".properties"),
323324
"Failed to create domain properties file");
324325
Properties p = new Properties();
325-
p.setProperty("domain_path", "/shared/domains");
326+
p.setProperty("domain_path", uniquePath);
326327
p.setProperty("domain_name", domainUid);
327328
p.setProperty("cluster_name", clusterName);
328329
p.setProperty("admin_server_name", adminServerName);
@@ -334,7 +335,7 @@ private void createDomain() {
334335
p.setProperty("admin_t3_channel_port", Integer.toString(t3ChannelPort));
335336
p.setProperty("number_of_ms", "2");
336337
p.setProperty("managed_server_name_base", managedServerNameBase);
337-
p.setProperty("domain_logs", "/shared/logs");
338+
p.setProperty("domain_logs", uniquePath + "/logs");
338339
p.setProperty("production_mode_enabled", "true");
339340
assertDoesNotThrow(()
340341
-> p.store(new FileOutputStream(domainPropertiesFile), "domain properties file"),
@@ -359,7 +360,7 @@ private void createDomain() {
359360
.configuration(new Configuration()
360361
.overrideDistributionStrategy("DYNAMIC"))
361362
.domainUid(domainUid)
362-
.domainHome("/shared/domains/" + domainUid) // point to domain home in pv
363+
.domainHome(uniquePath + "/" + domainUid) // point to domain home in pv
363364
.domainHomeSourceType("PersistentVolume") // set the domain home source type as pv
364365
.image(WEBLOGIC_IMAGE_TO_USE_IN_SPEC)
365366
.imagePullPolicy("IfNotPresent")
@@ -371,7 +372,7 @@ private void createDomain() {
371372
.namespace(domainNamespace))
372373
.includeServerOutInPodLog(true)
373374
.logHomeEnabled(Boolean.TRUE)
374-
.logHome("/shared/logs/" + domainUid)
375+
.logHome(uniquePath + "/logs/" + domainUid)
375376
.dataHome("")
376377
.serverStartPolicy("IF_NEEDED")
377378
.serverPod(new ServerPod() //serverpod

integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/WebLogicRemoteConsole.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import static oracle.weblogic.kubernetes.actions.ActionConstants.WORK_DIR;
1414
import static oracle.weblogic.kubernetes.actions.impl.primitive.Installer.defaultInstallRemoteconsoleParams;
1515
import static oracle.weblogic.kubernetes.utils.ApplicationUtils.callWebAppAndWaitTillReady;
16+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.testUntil;
1617
import static oracle.weblogic.kubernetes.utils.ExecCommand.exec;
1718
import static oracle.weblogic.kubernetes.utils.FileUtils.copyFileFromPod;
1819
import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
@@ -103,7 +104,11 @@ private static boolean accessRemoteconsole() {
103104
+ " --write-out %{http_code} -o /dev/null";
104105
logger.info("Executing curl command {0}", curlCmd);
105106

106-
return callWebAppAndWaitTillReady(curlCmd, 10);
107+
testUntil((() -> {
108+
return callWebAppAndWaitTillReady(curlCmd, 1);
109+
}), logger, "Waiting for remote console access to return 200 status code");
110+
111+
return true;
107112

108113
}
109114

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonMiiTestUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ public static Domain createDomainResourceWithLogHome(
533533
securityList.add(dbSecretName);
534534
}
535535

536+
String uniquePath = "/shared/" + domNamespace + "/" + domainResourceName;
536537
DomainSpec domainSpec = new DomainSpec()
537538
.domainUid(domainResourceName)
538539
.domainHomeSourceType("FromModel")
@@ -545,7 +546,7 @@ public static Domain createDomainResourceWithLogHome(
545546
.namespace(domNamespace))
546547
.includeServerOutInPodLog(true)
547548
.logHomeEnabled(Boolean.TRUE)
548-
.logHome("/shared/logs")
549+
.logHome(uniquePath + "/logs")
549550
.serverStartPolicy("IF_NEEDED")
550551
.serverPod(new ServerPod()
551552
.addEnvItem(new V1EnvVar()
@@ -582,7 +583,7 @@ public static Domain createDomainResourceWithLogHome(
582583
.introspectorJobActiveDeadlineSeconds(300L));
583584

584585
if (setDataHome) {
585-
domainSpec.dataHome("/shared/data");
586+
domainSpec.dataHome(uniquePath + "/data");
586587
}
587588
// create the domain CR
588589
Domain domain = new Domain()

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/DomainUtils.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ public static Domain createDomainResourceForDomainOnPV(String domainUid,
346346
String pvcName,
347347
String clusterName,
348348
int replicaCount) {
349+
350+
String uniquePath = "/u01/shared/" + domainNamespace + "/domains/" + domainUid;
349351
// create the domain custom resource
350352
getLogger().info("Creating domain custom resource");
351353
Domain domain = new Domain()
@@ -356,7 +358,7 @@ public static Domain createDomainResourceForDomainOnPV(String domainUid,
356358
.namespace(domainNamespace))
357359
.spec(new DomainSpec()
358360
.domainUid(domainUid)
359-
.domainHome("/u01/shared/domains/" + domainUid)
361+
.domainHome(uniquePath)
360362
.domainHomeSourceType("PersistentVolume")
361363
.image(WEBLOGIC_IMAGE_TO_USE_IN_SPEC)
362364
.imagePullPolicy("IfNotPresent")
@@ -368,7 +370,7 @@ public static Domain createDomainResourceForDomainOnPV(String domainUid,
368370
.namespace(domainNamespace))
369371
.includeServerOutInPodLog(true)
370372
.logHomeEnabled(Boolean.TRUE)
371-
.logHome("/u01/shared/logs/" + domainUid)
373+
.logHome(uniquePath + "/logs")
372374
.dataHome("")
373375
.serverStartPolicy("IF_NEEDED")
374376
.serverPod(new ServerPod()
@@ -428,6 +430,8 @@ private static void runCreateDomainOnPVJobUsingWdt(Path domainCreationScriptFile
428430
domainScriptFiles.add(domainCreationScriptFile);
429431
domainScriptFiles.add(domainPropertiesFile);
430432
domainScriptFiles.add(modelFile);
433+
434+
String uniquePath = "/u01/shared/" + namespace + "/domains/" + domainUid;
431435

432436
getLogger().info("Creating a config map to hold domain creation scripts");
433437
String domainScriptConfigMapName = "create-domain-scripts-cm-" + testClassName.toLowerCase();
@@ -459,7 +463,7 @@ private static void runCreateDomainOnPVJobUsingWdt(Path domainCreationScriptFile
459463
.value(System.getenv("http_proxy")))
460464
.addEnvItem(new V1EnvVar()
461465
.name("DOMAIN_HOME_DIR")
462-
.value("/u01/shared/domains/" + domainUid))
466+
.value(uniquePath))
463467
.addEnvItem(new V1EnvVar()
464468
.name("https_proxy")
465469
.value(HTTPS_PROXY));

0 commit comments

Comments
 (0)