Skip to content

Commit 141657b

Browse files
committed
Merge branch 'try-ipv6-sankar' into 'main'
update tests for running in kubernetes clusters configured for IPV6 addresses See merge request weblogic-cloud/weblogic-kubernetes-operator!4496
2 parents c87440d + a2b05f8 commit 141657b

39 files changed

+500
-185
lines changed

Jenkinsfile.kindnightly

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def kind_k8s_map = [
6262
def _kind_image = null
6363
CRON_SETTINGS = '''H 1 * * * % MAVEN_PROFILE_NAME=kind-parallel
6464
H 2 * * * % MAVEN_PROFILE_NAME=kind-sequential
65-
H 3 * * * % MAVEN_PROFILE_NAME=kind-upgrade;KUBE_VERSION=1.24.12;KIND_VERSION=0.18.0'''
65+
H 3 * * * % MAVEN_PROFILE_NAME=kind-upgrade;KUBE_VERSION=1.24.12;KIND_VERSION=0.18.0
66+
H 4 * * * % MAVEN_PROFILE_NAME=ipv6;IP_FAMILY=ipv6'''
6667

6768

6869
pipeline {
@@ -108,6 +109,14 @@ pipeline {
108109
description: 'The branch to run the tests on',
109110
defaultValue: 'main'
110111
)
112+
choice(name: 'IP_FAMILY',
113+
description: 'Ip Family.',
114+
choices: [
115+
'ipv4',
116+
'ipv6',
117+
'dual'
118+
]
119+
)
111120
choice(name: 'MAVEN_PROFILE_NAME',
112121
description: 'Profile to use in mvn command to run the tests. Possible values are kind-parallel (the default), kind-sequential, kind-upgrade,toolkits-srg, wls-srg and integration-tests. Refer to weblogic-kubernetes-operator/integration-tests/pom.xml on the branch.',
113122
choices: [
@@ -116,7 +125,8 @@ pipeline {
116125
'kind-upgrade',
117126
'integration-tests',
118127
'toolkits-srg',
119-
'wls-srg'
128+
'wls-srg',
129+
'ipv6'
120130
]
121131
)
122132
string(name: 'IT_TEST',
@@ -434,7 +444,7 @@ pipeline {
434444
kind: Cluster
435445
apiVersion: kind.x-k8s.io/v1alpha4
436446
networking:
437-
podSubnet: 192.168.0.0/16
447+
ipFamily: ${IP_FAMILY}
438448
containerdConfigPatches:
439449
- |-
440450
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."localhost:${registry_port}"]
@@ -525,7 +535,11 @@ EOF
525535
export KUBECONFIG=${kubeconfig_file}
526536
mkdir -m777 -p "${WORKSPACE}/.mvn"
527537
touch ${WORKSPACE}/.mvn/maven.config
528-
K8S_NODEPORT_HOST=$(kubectl get node kind-worker -o jsonpath='{.status.addresses[?(@.type == "InternalIP")].address}')
538+
address_stack=$(kubectl get node kind-worker -o jsonpath='{.status.addresses[?(@.type == "InternalIP")].address}')
539+
addresses=($address_stack)
540+
echo address_stack
541+
echo "IPV4 address ${addresses[0]}"
542+
K8S_NODEPORT_HOST=${addresses[0]}
529543
if [ "${MAVEN_PROFILE_NAME}" == "kind-sequential" ]; then
530544
PARALLEL_RUN='false'
531545
fi

integration-tests/pom.xml

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,69 @@
589589
</includes-failsafe>
590590
</properties>
591591
</profile>
592-
592+
<profile>
593+
<id>ipv6</id>
594+
<properties>
595+
<skipITs>false</skipITs>
596+
<includes-failsafe>
597+
**/ItCoherenceTests,
598+
**/ItConfigDistributionStrategy,
599+
**/ItConsensusLeasingValidation,
600+
**/ItDataHomeOverride,
601+
**/ItDiagnosticsCompleteAvailableCondition,
602+
**/ItElasticLoggingFluentd,
603+
**/ItElasticLoggingSample,
604+
**/ItEvictedPodsCycling,
605+
**/ItExternalNodePortService,
606+
**/ItHorizontalPodAutoscaler,
607+
**/ItHorizontalPodAutoscalerCustomMetrics,
608+
**/ItInitContainers,
609+
**/ItIntrospectVersion,
610+
**/ItIstioCoherenceTests,
611+
**/ItIstioDomainInImage,
612+
**/ItIstioManagedCoherence,
613+
**/ItIstioMiiDomain,
614+
**/ItIstioMonitoringExporter,
615+
**/ItIstioProductionSecureMode,
616+
**/ItIstioSessionMigration,
617+
**/ItKubernetesDomainEvents,
618+
**/ItKubernetesNameSpaceWatchingEvents,
619+
**/ItLBTwoDomainsNginx,
620+
**/ItLBTwoDomainsTraefik,
621+
**/ItLivenessProbeCustomization,
622+
**/ItManageNameSpace,
623+
**/ItManagedCoherence,
624+
**/ItMaxConcurOptions,
625+
**/ItMiiAuxiliaryImage,
626+
**/ItMiiClusterResource,
627+
**/ItMiiCreateAuxImageWithImageTool,
628+
**/ItMiiCustomSslStore,
629+
**/ItMiiDomain,
630+
**/ItMiiDomainModelInPV,
631+
**/ItMiiDynamicUpdatePart1,
632+
**/ItMiiDynamicUpdatePart2,
633+
**/ItMiiDynamicUpdatePart3,
634+
**/ItMiiMultiModel,
635+
**/ItMiiUpdateDomainConfig,
636+
**/ItMonitoringExporterSideCar,
637+
**/ItOperatorRestart,
638+
**/ItPodTemplates,
639+
**/ItPodsRestart,
640+
**/ItPodsShutdownOption,
641+
**/ItProductionSecureMode,
642+
**/ItRecoveryDomainInPV,
643+
**/ItRemoteConsole,
644+
**/ItRetryImprovementMisc,
645+
**/ItRetryImprovements,
646+
**/ItServerStartPolicy,
647+
**/ItServerStartPolicyConfigCluster,
648+
**/ItServerStartPolicyDynamicCluster,
649+
**/ItSystemResOverrides,
650+
**/ItTwoDomainsManagedByTwoOperators,
651+
**/ItWlsDomainOnPV
652+
</includes-failsafe>
653+
</properties>
654+
</profile>
593655
<profile>
594656
<id>wko-okd-fmw-cert</id>
595657
<properties>
@@ -605,7 +667,6 @@
605667
</includes-failsafe>
606668
</properties>
607669
</profile>
608-
609670
<profile>
610671
<id>wko-okd-wls-cert</id>
611672
<properties>

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2022, 2023, 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;
@@ -384,7 +384,7 @@ private static void buildApplicationsAndDomains() {
384384
@DisplayName("Check cross domain transaction works")
385385
void testCrossDomainTransaction() {
386386

387-
String curlRequest = String.format("curl -v --show-error --noproxy '*' "
387+
String curlRequest = String.format("curl -g -v --show-error --noproxy '*' "
388388
+ "http://%s/TxForward/TxForward?urls=t3://%s.%s:7001,t3://%s1.%s:8001,t3://%s1.%s:8001,t3://%s2.%s:8001",
389389
hostAndPort, domain1AdminServerPodName, domain1Namespace,
390390
domain1ManagedServerPrefix, domain1Namespace, domain2ManagedServerPrefix, domain2Namespace,
@@ -418,7 +418,7 @@ void testCrossDomainTransaction() {
418418
@DisplayName("Check cross domain transaction with TMAfterTLogBeforeCommitExit property commits")
419419
void testCrossDomainTransactionWithFailInjection() {
420420

421-
String curlRequest = String.format("curl -v --show-error --noproxy '*' "
421+
String curlRequest = String.format("curl -g -v --show-error --noproxy '*' "
422422
+ "http://%s/cdttxservlet/cdttxservlet?namespaces=%s,%s",
423423
hostAndPort, domain1Namespace, domain2Namespace);
424424

@@ -462,7 +462,7 @@ void testCrossDomainTranscatedMDB() {
462462

463463
logger.info("MDB application is activated on domain1/cluster");
464464

465-
String curlRequest = String.format("curl -v --show-error --noproxy '*' "
465+
String curlRequest = String.format("curl -g -v --show-error --noproxy '*' "
466466
+ "\"http://%s/jmsservlet/jmstest?"
467467
+ "url=t3://domain2-cluster-cluster-1.%s:8001&"
468468
+ "cf=jms.ClusterConnectionFactory&"
@@ -486,7 +486,7 @@ void testCrossDomainTranscatedMDB() {
486486
}
487487

488488
private boolean checkLocalQueue() {
489-
String curlString = String.format("curl -v --show-error --noproxy '*' "
489+
String curlString = String.format("curl -g -v --show-error --noproxy '*' "
490490
+ "\"http://%s/jmsservlet/jmstest?"
491491
+ "url=t3://localhost:7001&"
492492
+ "action=receive&dest=jms.testAccountingQueue\"",

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

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,11 @@ private static void buildApplicationsAndDomains() {
371371
// We can not verify Rest Management console thru Adminstration NodePort
372372
// in istio, as we can not enable Adminstration NodePort
373373
if (!WEBLOGIC_SLIM) {
374-
String consoleUrl = "http://" + hostAndPort + "/console/login/LoginForm.jsp";
374+
String host = K8S_NODEPORT_HOST;
375+
if (host.contains(":")) {
376+
host = "[" + host + "]";
377+
}
378+
String consoleUrl = "http://" + host + ":" + istioIngressPort + "/console/login/LoginForm.jsp";
375379
boolean checkConsole =
376380
checkAppUsingHostHeader(consoleUrl, "domain1-" + domain1Namespace + ".org");
377381
assertTrue(checkConsole, "Failed to access WebLogic console on domain1");
@@ -445,7 +449,7 @@ void testIstioCrossDomainTransaction() {
445449
@DisplayName("Check cross domain transaction with istio and with TMAfterTLogBeforeCommitExit property commits")
446450
@DisabledIfEnvironmentVariable(named = "OKE_CLUSTER", matches = "true")
447451
void testIstioCrossDomainTransactionWithFailInjection() {
448-
String curlRequest = String.format("curl -v --show-error --noproxy '*' "
452+
String curlRequest = String.format("curl -g -v --show-error --noproxy '*' "
449453
+ "-H 'host:domain1-" + domain1Namespace + ".org' "
450454
+ "http://%s:%s/cdttxservlet/cdttxservlet?namespaces=%s,%s",
451455
K8S_NODEPORT_HOST, istioIngressPort, domain1Namespace, domain2Namespace);
@@ -491,21 +495,27 @@ void testIstioCrossDomainTranscatedMDB() {
491495
"MDB application can not be activated on domain1/cluster");
492496

493497
logger.info("MDB application is activated on domain1/cluster");
498+
499+
String host = K8S_NODEPORT_HOST;
500+
if (host.contains(":")) {
501+
host = "[" + host + "]";
502+
}
494503
String curlRequest = OKE_CLUSTER
495-
? String.format("curl -v --show-error --noproxy '*' "
504+
? String.format("curl -g -v --show-error --noproxy '*' "
496505
+ "-H 'host:domain1-" + domain1Namespace + ".org' "
497506
+ "\"http://%s/jmsservlet/jmstest?"
498507
+ "url=t3://domain2-cluster-cluster-1.%s:8001&"
499508
+ "cf=jms.ClusterConnectionFactory&"
500509
+ "action=send&"
501510
+ "dest=jms/testCdtUniformTopic\"", hostAndPort, domain2Namespace)
502-
: String.format("curl -v --show-error --noproxy '*' "
511+
: String.format("curl -g -v --show-error --noproxy '*' "
503512
+ "-H 'host:domain1-" + domain1Namespace + ".org' "
504513
+ "\"http://%s:%s/jmsservlet/jmstest?"
505514
+ "url=t3://domain2-cluster-cluster-1.%s:8001&"
506515
+ "cf=jms.ClusterConnectionFactory&"
507516
+ "action=send&"
508-
+ "dest=jms/testCdtUniformTopic\"", K8S_NODEPORT_HOST, istioIngressPort, domain2Namespace);
517+
+ "dest=jms/testCdtUniformTopic\"",
518+
host, istioIngressPort, domain2Namespace);
509519

510520
ExecResult result = null;
511521
logger.info("curl command {0}", curlRequest);
@@ -521,23 +531,27 @@ void testIstioCrossDomainTranscatedMDB() {
521531
}
522532

523533
private boolean checkLocalQueue() {
534+
String host = K8S_NODEPORT_HOST;
535+
if (host.contains(":")) {
536+
host = "[" + host + "]";
537+
}
524538
// In internal OKE env, use Istio EXTERNAL-IP;
525539
// in non-internal-OKE env, use K8S_NODEPORT_HOST + ":" + istioIngressPort
526540
String hostAndPort = getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) != null
527541
? getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace)
528-
: K8S_NODEPORT_HOST + ":" + istioIngressPort;
542+
: host + ":" + istioIngressPort;
529543

530544
String curlString = OKE_CLUSTER
531-
? String.format("curl -v --show-error --noproxy '*' "
545+
? String.format("curl -g -v --show-error --noproxy '*' "
532546
+ "-H 'host:domain1-" + domain1Namespace + ".org' "
533547
+ "\"http://%s/jmsservlet/jmstest?"
534548
+ "url=t3://localhost:7001&"
535549
+ "action=receive&dest=jms.testAccountingQueue\"", hostAndPort)
536-
: String.format("curl -v --show-error --noproxy '*' "
550+
: String.format("curl -g -v --show-error --noproxy '*' "
537551
+ "-H 'host:domain1-" + domain1Namespace + ".org' "
538552
+ "\"http://%s:%s/jmsservlet/jmstest?"
539553
+ "url=t3://localhost:7001&"
540-
+ "action=receive&dest=jms.testAccountingQueue\"", K8S_NODEPORT_HOST, istioIngressPort);
554+
+ "action=receive&dest=jms.testAccountingQueue\"", host, istioIngressPort);
541555

542556
logger.info("curl command {0}", curlString);
543557
testUntil(assertDoesNotThrow(

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022, Oracle and/or its affiliates.
1+
// Copyright (c) 2022, 2023, 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;
@@ -331,7 +331,11 @@ void testIstioEnabledFmwModelInImageWithDbOperator() {
331331
// We can not verify Rest Management console thru Adminstration NodePort
332332
// in istio, as we can not enable Adminstration NodePort
333333
if (!WEBLOGIC_SLIM) {
334-
String consoleUrl = "http://" + K8S_NODEPORT_HOST + ":" + istioIngressPort + "/console/login/LoginForm.jsp";
334+
String host = K8S_NODEPORT_HOST;
335+
if (host.contains(":")) {
336+
host = "[" + host + "]";
337+
}
338+
String consoleUrl = "http://" + host + ":" + istioIngressPort + "/console/login/LoginForm.jsp";
335339
boolean checkConsole =
336340
checkAppUsingHostHeader(consoleUrl, fmwDomainNamespace + ".org");
337341
assertTrue(checkConsole, "Failed to access WebLogic console");
@@ -353,10 +357,14 @@ void testIstioEnabledFmwModelInImageWithDbOperator() {
353357
}
354358

355359
if (isWebLogicPsuPatchApplied()) {
356-
String curlCmd2 = "curl -j -sk --show-error --noproxy '*' "
360+
String host = K8S_NODEPORT_HOST;
361+
if (host.contains(":")) {
362+
host = "[" + host + "]";
363+
}
364+
String curlCmd2 = "curl -g -j -sk --show-error --noproxy '*' "
357365
+ " -H 'Host: " + fmwDomainNamespace + ".org'"
358366
+ " --user " + ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT
359-
+ " --url http://" + K8S_NODEPORT_HOST + ":" + istioIngressPort
367+
+ " --url http://" + host + ":" + istioIngressPort
360368
+ "/management/weblogic/latest/domainRuntime/domainSecurityRuntime?"
361369
+ "link=none";
362370

@@ -389,7 +397,11 @@ void testIstioEnabledFmwModelInImageWithDbOperator() {
389397
logger.info("Application deployment returned {0}", result.toString());
390398
assertEquals("202", result.stdout(), "Deployment didn't return HTTP status code 202");
391399

392-
String url = "http://" + K8S_NODEPORT_HOST + ":" + istioIngressPort + "/testwebapp/index.jsp";
400+
String host = K8S_NODEPORT_HOST;
401+
if (host.contains(":")) {
402+
host = "[" + host + "]";
403+
}
404+
String url = "http://" + host + ":" + istioIngressPort + "/testwebapp/index.jsp";
393405
logger.info("Application Access URL {0}", url);
394406
hostHeader = fmwDomainNamespace + ".org";
395407
boolean checkApp = checkAppUsingHostHeader(url, hostHeader);
@@ -622,7 +634,7 @@ private void runJmsClientOnAdminPod(String action, String queue) {
622634
**/
623635
private boolean checkJmsServerRuntime(String jmsServer, String managedServer) {
624636
String hostAndPort = getHostAndPort(adminSvcExtRouteHost, wlDomainIstioIngressPort);
625-
StringBuffer curlString = new StringBuffer("status=$(curl --user "
637+
StringBuffer curlString = new StringBuffer("status=$(curl -g --user "
626638
+ ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT
627639
+ " -H 'host: " + hostHeader + " ' ");
628640
curlString.append("http://" + hostAndPort)
@@ -651,7 +663,7 @@ private boolean checkJmsServerRuntime(String jmsServer, String managedServer) {
651663
**/
652664
private boolean checkStoreRuntime(String storeName, String managedServer) {
653665
String hostAndPort = getHostAndPort(adminSvcExtRouteHost, wlDomainIstioIngressPort);
654-
StringBuffer curlString = new StringBuffer("status=$(curl --user "
666+
StringBuffer curlString = new StringBuffer("status=$(curl -g --user "
655667
+ ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT + " "
656668
+ " -H 'host: " + hostHeader + " ' ");
657669
curlString.append("http://" + hostAndPort)
@@ -682,7 +694,7 @@ private boolean checkStoreRuntime(String storeName, String managedServer) {
682694
**/
683695
private boolean checkJtaRecoveryServiceRuntime(String managedServer, String recoveryService, String active) {
684696
String hostAndPort = getHostAndPort(adminSvcExtRouteHost, wlDomainIstioIngressPort);
685-
StringBuffer curlString = new StringBuffer("curl --user "
697+
StringBuffer curlString = new StringBuffer("curl -g --user "
686698
+ ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT
687699
+ " -H 'host: " + hostHeader + " ' ");
688700
curlString.append("\"http://" + hostAndPort)

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

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,13 @@ void testIstioDomainHomeInImage() {
211211
// We can not verify Rest Management console thru Adminstration NodePort
212212
// in istio, as we can not enable Adminstration NodePort
213213
if (!WEBLOGIC_SLIM) {
214-
String consoleUrl = "http://" + hostAndPort + "/console/login/LoginForm.jsp";
215-
boolean checkConsole = checkAppUsingHostHeader(consoleUrl, domainNamespace + ".org");
214+
String host = K8S_NODEPORT_HOST;
215+
if (host.contains(":")) {
216+
host = "[" + host + "]";
217+
}
218+
String consoleUrl = "http://" + host + ":" + istioIngressPort + "/console/login/LoginForm.jsp";
219+
boolean checkConsole =
220+
checkAppUsingHostHeader(consoleUrl, domainNamespace + ".org");
216221
assertTrue(checkConsole, "Failed to access WebLogic console");
217222
logger.info("WebLogic console is accessible");
218223
String localhost = "localhost";
@@ -252,14 +257,19 @@ void testIstioDomainHomeInImage() {
252257
assertEquals("202", result.stdout(), "Deployment didn't return HTTP status code 202");
253258
logger.info("Application {0} deployed successfully at {1}", "testwebapp.war", domainUid + "-" + clusterName);
254259

260+
String host = K8S_NODEPORT_HOST;
261+
if (host.contains(":")) {
262+
host = "[" + host + "]";
263+
}
264+
String url = "http://" + host + ":" + istioIngressPort + "/testwebapp/index.jsp";
265+
255266
if (OKE_CLUSTER) {
256267
testUntil(isAppInServerPodReady(domainNamespace,
257268
managedServerPrefix + 1, 8001, "/testwebapp/index.jsp", "testwebapp"),
258269
logger, "Check Deployed App {0} in server {1}",
259270
archivePath,
260271
target);
261272
} else {
262-
String url = "http://" + hostAndPort + "/testwebapp/index.jsp";
263273
logger.info("Application Access URL {0}", url);
264274
boolean checkApp = checkAppUsingHostHeader(url, domainNamespace + ".org");
265275
assertTrue(checkApp, "Failed to access WebLogic application");
@@ -272,10 +282,10 @@ void testIstioDomainHomeInImage() {
272282

273283
logger.info("Istio Ingress Port is {0}", istioIngressPort);
274284
if (isWebLogicPsuPatchApplied()) {
275-
String curlCmd2 = "curl -j -sk --show-error --noproxy '*' "
285+
String curlCmd2 = "curl -g -j -sk --show-error --noproxy '*' "
276286
+ " -H 'Host: " + domainNamespace + ".org'"
277287
+ " --user " + ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT
278-
+ " --url http://" + hostAndPort
288+
+ " --url http://" + host + ":" + istioIngressPort
279289
+ "/management/weblogic/latest/domainRuntime/domainSecurityRuntime?"
280290
+ "link=none";
281291

0 commit comments

Comments
 (0)