Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ public static void initAll(@Namespaces(5) List<String> namespaces) {

// install operator and verify its running in ready state
installAndVerifyOperator(opNamespace, domainNamespace);

}

/**
Expand Down Expand Up @@ -208,7 +207,7 @@ void testSampleDomainInImage(String model) {

/**
* Test domain in pv samples using domains created by wlst and wdt.
* In domain on pv using wdt usecase, we also run the update domain script from the samples,
* In domain on pv using wdt and wlst usecases, we also run the update domain script from the samples,
* to add a cluster to the domain.
*
* @param model domain name and script type to create domain. Acceptable values of format String:wlst|wdt
Expand Down Expand Up @@ -255,13 +254,11 @@ void testSampleDomainInPv(String model) {
// run create-domain.sh to create domain.yaml file, run kubectl to create the domain and verify
createDomainAndVerify(domainName, sampleBase);

if (script.equals("wdt")) {
copyModelFileForUpdateDomain(sampleBase);
updateDomainAndVerify(domainName, sampleBase, domainNamespace);
}
// update the domain to add a new cluster
copyModelFileForUpdateDomain(sampleBase);
updateDomainAndVerify(domainName, sampleBase, domainNamespace, script);
}


/**
* Test scripts for stopping and starting a managed server.
*/
Expand Down Expand Up @@ -621,7 +618,10 @@ private void createDomainAndVerify(String domainName, Path sampleBase, String...
}
}

private void updateDomainAndVerify(String domainName, Path sampleBase, String domainNamespace) {
private void updateDomainAndVerify(String domainName,
Path sampleBase,
String domainNamespace,
String script) {
//First copy the update model file to wdt dir and rename it wdt-model_dynamic.yaml
assertDoesNotThrow(() -> {
copyFile(Paths.get(sampleBase.toString(), UPDATE_MODEL_FILE).toFile(),
Expand All @@ -640,6 +640,22 @@ private void updateDomainAndVerify(String domainName, Path sampleBase, String do
boolean result = Command.withParams(params).execute();
assertTrue(result, "Failed to create domain.yaml");

// For the domain created by WLST, we have to apply domain.yaml created by update-domain.sh
// before initiating introspection of the domain to start the second cluster that was just added
// otherwise the newly added Cluster 'cluster-2' is not added to the domain1.
if (script.equals("wlst")) {
// run kubectl to update the domain
logger.info("Run kubectl to create the domain");
params = new CommandParams().defaults();
params.command("kubectl apply -f "
+ Paths.get(sampleBase.toString(), "weblogic-domains/"
+ domainName
+ "/domain.yaml").toString());

result = Command.withParams(params).execute();
assertTrue(result, "Failed to create domain custom resource");
}

// Have to initiate introspection of the domain to start the second cluster that was just added
// Call introspectDomain.sh
String extraParams = " -d " + domainName + " -n " + domainNamespace;
Expand Down