Skip to content

Commit f3e363f

Browse files
committed
Merge branch 'fixwdt1' into 'release/4.2'
Fixed wdt url download issue in OKE run - OWLS-127270 See merge request weblogic-cloud/weblogic-kubernetes-operator!4932
2 parents 6aac5af + 230bec8 commit f3e363f

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

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

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2024, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2025, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -72,10 +72,12 @@
7272
import static oracle.weblogic.kubernetes.TestConstants.TRAEFIK_INGRESS_HTTP_HOSTPORT;
7373
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_IMAGE_TAG_DEFAULT;
7474
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_IMAGE_TO_USE_IN_SPEC;
75+
import static oracle.weblogic.kubernetes.TestConstants.WEBLOGIC_SHIPHOME;
7576
import static oracle.weblogic.kubernetes.actions.ActionConstants.APP_DIR;
7677
import static oracle.weblogic.kubernetes.actions.ActionConstants.DOWNLOAD_DIR;
7778
import static oracle.weblogic.kubernetes.actions.ActionConstants.MODEL_DIR;
7879
import static oracle.weblogic.kubernetes.actions.ActionConstants.RESOURCE_DIR;
80+
import static oracle.weblogic.kubernetes.actions.ActionConstants.WDT;
7981
import static oracle.weblogic.kubernetes.actions.ActionConstants.WDT_DOWNLOAD_URL;
8082
import static oracle.weblogic.kubernetes.actions.TestActions.createSecret;
8183
import static oracle.weblogic.kubernetes.actions.TestActions.getNextIntrospectVersion;
@@ -84,6 +86,7 @@
8486
import static oracle.weblogic.kubernetes.actions.TestActions.shutdownDomain;
8587
import static oracle.weblogic.kubernetes.actions.TestActions.startDomain;
8688
import static oracle.weblogic.kubernetes.actions.impl.Domain.patchDomainCustomResource;
89+
import static oracle.weblogic.kubernetes.actions.impl.primitive.Command.defaultCommandParams;
8790
import static oracle.weblogic.kubernetes.assertions.TestAssertions.podStateNotChanged;
8891
import static oracle.weblogic.kubernetes.assertions.TestAssertions.secretExists;
8992
import static oracle.weblogic.kubernetes.utils.ApplicationUtils.verifyAdminServerRESTAccess;
@@ -95,6 +98,7 @@
9598
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkServiceExists;
9699
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.createIngressHostRouting;
97100
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.exeAppInServerPod;
101+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getActualLocationIfNeeded;
98102
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getDateAndTimeStamp;
99103
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getHostAndPort;
100104
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
@@ -202,6 +206,9 @@ public void initAll(@Namespaces(2) List<String> namespaces) throws IOException {
202206
// create pull secrets for WebLogic image when running in non Kind Kubernetes cluster
203207
// this secret is used only for non-kind cluster
204208
createBaseRepoSecret(domainNamespace);
209+
if (OKE_CLUSTER) {
210+
installOnPremWebLogic();
211+
}
205212

206213
//create and start WebLogic domain
207214
createDomain();
@@ -682,11 +689,13 @@ public static File createWdtPropertyFile(String wlsModelFilePrefix, String nodeP
682689
}
683690

684691
private static void downloadAndInstallWDT() throws IOException {
685-
String wdtUrl = WDT_DOWNLOAD_URL + "/download/weblogic-deploy.zip";
692+
693+
String wdtUrl = getActualLocationIfNeeded(WDT_DOWNLOAD_URL, WDT);
694+
686695
Path destLocation = Path.of(DOWNLOAD_DIR, "wdt", "weblogic-deploy.zip");
687696
encryptModelScript = Path.of(DOWNLOAD_DIR, "wdt", "weblogic-deploy", "bin", "encryptModel.sh");
688697
if (!Files.exists(destLocation) && !Files.exists(encryptModelScript)) {
689-
logger.info("Downloading WDT to {0}", destLocation);
698+
logger.info("Downloading WDT from {0} to {1}", wdtUrl, destLocation);
690699
Files.createDirectories(destLocation.getParent());
691700
OracleHttpClient.downloadFile(wdtUrl, destLocation.toString(), null, null, 3);
692701
String cmd = "cd " + destLocation.getParent() + ";unzip " + destLocation;
@@ -737,4 +746,16 @@ public static void createEncryptionSecret(String secretName, String namespace) {
737746
assertTrue(secretCreated, String.format("create secret failed for %s", secretName));
738747
}
739748
}
749+
750+
private void installOnPremWebLogic() {
751+
Path installScript = Paths.get(RESOURCE_DIR, "bash-scripts", "install-wls.sh");
752+
String command
753+
= String.format("%s %s %s %s", "/bin/bash", installScript, RESULTS_ROOT, WEBLOGIC_SHIPHOME);
754+
getLogger().info("WebLogic installation command {0}", command);
755+
assertTrue(() -> Command.withParams(
756+
defaultCommandParams()
757+
.command(command)
758+
.redirect(false))
759+
.execute());
760+
}
740761
}

0 commit comments

Comments
 (0)