Skip to content

Commit 65fc5ba

Browse files
committed
Merge branch 'kind20-ol9-sankar' into 'main'
Kind20 ol9 - test changes See merge request weblogic-cloud/weblogic-kubernetes-operator!4539
2 parents 2f8e3f3 + b75356e commit 65fc5ba

39 files changed

+1565
-520
lines changed

Jenkinsfile.kindnightly

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2022, 2024, 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
def kind_k8s_map = [
@@ -423,7 +423,7 @@ pipeline {
423423
fi
424424

425425
docker run -d --restart=always -p "127.0.0.1:${registry_port}:5000" --name "${registry_name}" \
426-
${ocir_host}/${wko_tenancy}/test-images/docker/registry:2
426+
${ocir_host}/${wko_tenancy}/test-images/docker/registry:2.8.2
427427
echo "Registry Host: ${registry_host}"
428428
'''
429429
}

Jenkinsfile.podman

Lines changed: 576 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 129 additions & 85 deletions
Large diffs are not rendered by default.

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

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2021, 2024, 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;
@@ -43,6 +43,7 @@
4343
import static oracle.weblogic.kubernetes.TestConstants.MII_BASIC_IMAGE_TAG;
4444
import static oracle.weblogic.kubernetes.TestConstants.SKIP_CLEANUP;
4545
import static oracle.weblogic.kubernetes.TestConstants.TEST_IMAGES_REPO_SECRET_NAME;
46+
import static oracle.weblogic.kubernetes.TestConstants.TRAEFIK_INGRESS_HTTP_HOSTPORT;
4647
import static oracle.weblogic.kubernetes.actions.ActionConstants.ITTESTS_DIR;
4748
import static oracle.weblogic.kubernetes.actions.ActionConstants.MODEL_DIR;
4849
import static oracle.weblogic.kubernetes.actions.ActionConstants.RESOURCE_DIR;
@@ -61,6 +62,7 @@
6162
import static oracle.weblogic.kubernetes.utils.CommonMiiTestUtils.createDomainSecret;
6263
import static oracle.weblogic.kubernetes.utils.CommonMiiTestUtils.createJobToChangePermissionsOnPvHostPath;
6364
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodReadyAndServiceExists;
65+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.createIngressHostRouting;
6466
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getHostAndPort;
6567
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getUniqueName;
6668
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.runClientInsidePod;
@@ -126,6 +128,8 @@ class ItDBOperator {
126128
private static LoggingFacade logger = null;
127129

128130
private String fmwDomainUid = "fmwdomain-mii-db";
131+
private String adminServerName = "admin-server";
132+
private static int adminPort = 7001;
129133
private String fmwAdminServerPodName = fmwDomainUid + "-admin-server";
130134
private String fmwManagedServerPrefix = fmwDomainUid + "-managed-server";
131135
private int replicaCount = 2;
@@ -149,6 +153,8 @@ class ItDBOperator {
149153
private final Path domainLifecycleSamplePath = Paths.get(samplePath + "/scripts/domain-lifecycle");
150154
private final String fmwClusterResName = fmwDomainUid + "-" + clusterName;
151155
private final String wlsClusterResName = wlsDomainUid + "-" + clusterName;
156+
157+
private static String hostHeader;
152158

153159
/**
154160
* Start DB service and create RCU schema.
@@ -280,7 +286,14 @@ void testFmwModelInImageWithDbOperator() {
280286
verifyDomainReady(fmwDomainNamespace, fmwDomainUid, replicaCount);
281287
// Expose the admin service external node port as a route for OKD
282288
adminSvcExtHost = createRouteForOKD(getExternalServicePodName(fmwAdminServerPodName), fmwDomainNamespace);
283-
verifyEMconsoleAccess(fmwDomainNamespace, fmwDomainUid, adminSvcExtHost);
289+
290+
if (TestConstants.KIND_CLUSTER
291+
&& !TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
292+
hostHeader = createIngressHostRouting(fmwDomainNamespace, fmwDomainUid, adminServerName, adminPort);
293+
verifyEMconsoleAccess(fmwDomainNamespace, fmwDomainUid, adminSvcExtHost, hostHeader);
294+
} else {
295+
verifyEMconsoleAccess(fmwDomainNamespace, fmwDomainUid, adminSvcExtHost);
296+
}
284297

285298
//Reuse the same RCU schema to restart JRF domain
286299
testReuseRCUschemaToRestartDomain();
@@ -374,6 +387,10 @@ void testWlsModelInImageWithDbOperator() {
374387
checkPodReadyAndServiceExists(wlsManagedServerPrefix + i, wlsDomainUid, wlsDomainNamespace);
375388
}
376389

390+
if (TestConstants.KIND_CLUSTER
391+
&& !TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
392+
hostHeader = createIngressHostRouting(wlsDomainNamespace, wlsDomainUid, adminServerName, adminPort);
393+
}
377394
//Verify JMS/JTA Service migration with File(JDBC) Store
378395
testMiiJmsJtaServiceMigration();
379396
}
@@ -547,6 +564,11 @@ private boolean checkJmsServerRuntime(String jmsServer, String managedServer) {
547564
String hostAndPort = getHostAndPort(adminSvcExtRouteHost, adminServiceNodePort);
548565
StringBuffer curlString = new StringBuffer("status=$(curl --user "
549566
+ ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT + " ");
567+
if (TestConstants.KIND_CLUSTER
568+
&& !TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
569+
hostAndPort = "localhost:" + TRAEFIK_INGRESS_HTTP_HOSTPORT;
570+
curlString.append(" -H 'host: " + hostHeader + "' ");
571+
}
550572
curlString.append("http://" + hostAndPort)
551573
.append("/management/weblogic/latest/domainRuntime/serverRuntimes/")
552574
.append(managedServer)
@@ -578,6 +600,11 @@ private boolean checkStoreRuntime(String storeName, String managedServer) {
578600
String hostAndPort = getHostAndPort(adminSvcExtRouteHost, adminServiceNodePort);
579601
StringBuffer curlString = new StringBuffer("status=$(curl --user "
580602
+ ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT + " ");
603+
if (TestConstants.KIND_CLUSTER
604+
&& !TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
605+
hostAndPort = "localhost:" + TRAEFIK_INGRESS_HTTP_HOSTPORT;
606+
curlString.append(" -H 'host: " + hostHeader + "' ");
607+
}
581608
curlString.append("http://" + hostAndPort)
582609
.append("/management/weblogic/latest/domainRuntime/serverRuntimes/")
583610
.append(managedServer)
@@ -611,6 +638,11 @@ private boolean checkJtaRecoveryServiceRuntime(String managedServer, String reco
611638
String hostAndPort = getHostAndPort(adminSvcExtRouteHost, adminServiceNodePort);
612639
StringBuffer curlString = new StringBuffer("curl --user "
613640
+ ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT + " ");
641+
if (TestConstants.KIND_CLUSTER
642+
&& !TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
643+
hostAndPort = "localhost:" + TRAEFIK_INGRESS_HTTP_HOSTPORT;
644+
curlString.append(" -H 'host: " + hostHeader + "' ");
645+
}
614646
curlString.append("\"http://" + hostAndPort)
615647
.append("/management/weblogic/latest/domainRuntime/serverRuntimes/")
616648
.append(managedServer)

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

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2021, 2024, 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;
@@ -537,12 +537,7 @@ void testNonexistentPVC() {
537537
.claimName(pvcName)))
538538
.addVolumeMountsItem(new V1VolumeMount()
539539
.mountPath("/shared")
540-
.name(pvName)))
541-
.adminServer(new AdminServer() //admin server
542-
.adminService(new AdminService()
543-
.addChannelsItem(new Channel()
544-
.channelName("default")
545-
.nodePort(getNextFreePort())))));
540+
.name(pvName))));
546541
setPodAntiAffinity(domain);
547542

548543
ClusterResource cluster = createClusterResource(clusterResName, wlClusterName, domainNamespace, replicaCount);
@@ -893,11 +888,7 @@ private DomainResource createDomainResourceWithConfigMap(String domainUid,
893888
.adminServer(new AdminServer()
894889
.serverService(new ServerService()
895890
.annotations(keyValueMap)
896-
.labels(keyValueMap))
897-
.adminService(new AdminService()
898-
.addChannelsItem(new Channel()
899-
.channelName("default")
900-
.nodePort(getNextFreePort()))))
891+
.labels(keyValueMap)))
901892
.configuration(new Configuration()
902893
.model(new Model()
903894
.domainType("WLS")
@@ -946,11 +937,6 @@ private DomainResource createDomainResource(String domainUid, String domNamespac
946937
.addEnvItem(new V1EnvVar()
947938
.name("USER_MEM_ARGS")
948939
.value("-Djava.security.egd=file:/dev/./urandom ")))
949-
.adminServer(new AdminServer()
950-
.adminService(new AdminService()
951-
.addChannelsItem(new Channel()
952-
.channelName("default")
953-
.nodePort(getNextFreePort()))))
954940
.configuration(new Configuration()
955941
.model(new Model()
956942
.domainType("WLS")

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2024, 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;
@@ -207,7 +207,7 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
207207

208208
if (!OKD) {
209209
logger.info("Installing Traefik controller using helm");
210-
traefikHelmParams = installAndVerifyTraefik(traefikNamespace, 0, 0);
210+
traefikHelmParams = installAndVerifyTraefik(traefikNamespace, 0, 0).getHelmParams();
211211
}
212212

213213
// Create SSL certificate and key using openSSL with SAN extension

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

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2021, 2024, 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;
@@ -42,6 +42,7 @@
4242
import static oracle.weblogic.kubernetes.TestConstants.DOMAIN_API_VERSION;
4343
import static oracle.weblogic.kubernetes.TestConstants.DOMAIN_VERSION;
4444
import static oracle.weblogic.kubernetes.TestConstants.IMAGE_PULL_POLICY;
45+
import static oracle.weblogic.kubernetes.TestConstants.ITEXTERNALNODEPORTSERVICE_HOSTPORT;
4546
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST;
4647
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOSTNAME;
4748
import static oracle.weblogic.kubernetes.TestConstants.KUBERNETES_CLI;
@@ -153,10 +154,16 @@ public static void initAll(@Namespaces(2) List<String> namespaces) {
153154

154155
// Prepare the config map sparse model file from the template by replacing
155156
// Public Address of the custom channel with K8S_NODEPORT_HOST
156-
nextFreePort = getNextFreePort();
157-
Map<String, String> configTemplateMap = new HashMap<>();
158-
configTemplateMap.put("INGRESS_HOST", K8S_NODEPORT_HOST);
159-
configTemplateMap.put("FREE_PORT", String.valueOf(nextFreePort));
157+
Map<String, String> configTemplateMap = new HashMap<>();
158+
if (TestConstants.KIND_CLUSTER
159+
&& !TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
160+
configTemplateMap.put("INGRESS_HOST", "localhost");
161+
configTemplateMap.put("FREE_PORT", String.valueOf(ITEXTERNALNODEPORTSERVICE_HOSTPORT));
162+
} else {
163+
nextFreePort = getNextFreePort();
164+
configTemplateMap.put("INGRESS_HOST", K8S_NODEPORT_HOST);
165+
configTemplateMap.put("FREE_PORT", String.valueOf(nextFreePort));
166+
}
160167

161168
Path srcFile = Paths.get(RESOURCE_DIR,
162169
"wdt-models", "nodeport.tunneling.model.template.yaml");
@@ -221,8 +228,14 @@ void testExternalRmiAccessThruNodePortService() {
221228
templateMap.put("DOMAIN_NS", domainNamespace);
222229
templateMap.put("DOMAIN_UID", domainUid);
223230
templateMap.put("CLUSTER", clusterName);
224-
templateMap.put("INGRESS_HOST", K8S_NODEPORT_HOST);
225-
templateMap.put("FREE_PORT", String.valueOf(nextFreePort));
231+
if (TestConstants.KIND_CLUSTER
232+
&& !TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
233+
templateMap.put("INGRESS_HOST", "localhost");
234+
templateMap.put("FREE_PORT", String.valueOf(ITEXTERNALNODEPORTSERVICE_HOSTPORT));
235+
} else {
236+
templateMap.put("INGRESS_HOST", K8S_NODEPORT_HOST);
237+
templateMap.put("FREE_PORT", String.valueOf(nextFreePort));
238+
}
226239

227240
Path srcTunnelingFile = Paths.get(RESOURCE_DIR,
228241
"tunneling", "nodeport.tunneling.template.yaml");

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2024, 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;
@@ -52,7 +52,6 @@
5252
import static oracle.weblogic.kubernetes.utils.ClusterUtils.createClusterResource;
5353
import static oracle.weblogic.kubernetes.utils.CommonMiiTestUtils.verifyPodsNotRolled;
5454
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodReadyAndServiceExists;
55-
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
5655
import static oracle.weblogic.kubernetes.utils.DomainUtils.createDomainAndVerify;
5756
import static oracle.weblogic.kubernetes.utils.ImageUtils.createTestRepoSecret;
5857
import static oracle.weblogic.kubernetes.utils.ImageUtils.imageRepoLoginAndPushImageToRegistry;
@@ -353,7 +352,7 @@ private void createAndVerifyMiiDomain(String domainNamespace, String domainUid,
353352
.adminService(new AdminService()
354353
.addChannelsItem(new Channel()
355354
.channelName("default")
356-
.nodePort(getNextFreePort()))))
355+
.nodePort(0))))
357356
.configuration(new Configuration()
358357
.model(new Model()
359358
.domainType(WLS_DOMAIN_TYPE)

0 commit comments

Comments
 (0)