Skip to content

Commit 86a925a

Browse files
sankarpnrjeberhard
authored andcommitted
Fix for the introspectversion test failure in OKE and IPV6 jobs
1 parent 0569830 commit 86a925a

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ void testDomainIntrospectVersionRolling() {
497497
}
498498

499499
//verify admin server accessibility and the health of cluster members
500-
verifyMemberHealth(adminServerPodName, managedServerNames, ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT);
500+
verifyMemberHealth(adminServerPodName, managedServerNames,
501+
ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT);
501502

502503
// verify each managed server can see other member in the cluster
503504
for (String managedServerName : managedServerNames) {
@@ -1319,11 +1320,12 @@ private static void verifyMemberHealth(String adminServerPodName, List<String> m
13191320
testUntil(() -> {
13201321
if (OKE_CLUSTER) {
13211322
// In internal OKE env, verifyMemberHealth in admin server pod
1322-
int adminPort = 7001;
1323+
int servicePort = getServicePort(introDomainNamespace,
1324+
getExternalServicePodName(adminServerPodName), "default");
13231325
final String command = KUBERNETES_CLI + " exec -n "
13241326
+ introDomainNamespace + " " + adminServerPodName + " -- curl http://"
13251327
+ adminServerPodName + ":"
1326-
+ adminPort + "/clusterview/ClusterViewServlet"
1328+
+ servicePort + "/clusterview/ClusterViewServlet"
13271329
+ "\"?user=" + user
13281330
+ "&password=" + code + "\"";
13291331

@@ -1335,6 +1337,8 @@ private static void verifyMemberHealth(String adminServerPodName, List<String> m
13351337
}
13361338
String response = result.stdout().trim();
13371339
logger.info(response);
1340+
logger.info(result.stderr());
1341+
logger.info("{0}", result.exitValue());
13381342
boolean health = true;
13391343
for (String managedServer : managedServerNames) {
13401344
health = health && response.contains(managedServer + ":HEALTH_OK");
@@ -1395,14 +1399,12 @@ private static void verifyMemberHealth(String adminServerPodName, List<String> m
13951399

13961400
private void verifyConnectionBetweenClusterMembers(String serverName, List<String> managedServerNames) {
13971401
String podName = domainUid + "-" + serverName;
1402+
boolean ipv6 = K8S_NODEPORT_HOST.contains(":");
13981403
final String command = String.format(
13991404
KUBERNETES_CLI + " exec -n " + introDomainNamespace + " " + podName + " -- curl \"http://"
1400-
+ wlsUserName
1401-
+ ":"
1402-
+ wlsPassword
1403-
+ "@" + podName + ":%s/clusterview/ClusterViewServlet"
1404-
+ "?user=" + wlsUserName
1405-
+ "&password=" + wlsPassword + "\"",managedServerPort);
1405+
+ podName + ":%s/clusterview/ClusterViewServlet"
1406+
+ "?user=" + wlsUserName
1407+
+ "&password=" + wlsPassword + "&ipv6=" + ipv6 + "\"", managedServerPort);
14061408
verifyServerCommunication(command, serverName, managedServerNames);
14071409
}
14081410

integration-tests/src/test/resources/apps/clusterview/src/java/oracle/weblogic/kubernetes/applications/clusterview/ClusterViewServlet.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public class ClusterViewServlet extends HttpServlet {
5050
DomainRuntimeMBean domainRuntime;
5151
String adminUser;
5252
String adminPassword;
53+
boolean ipv6;
5354
List<JMXConnector> jmxConnectors;
5455

5556
@Override
@@ -110,6 +111,7 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
110111
jmxConnectors = new ArrayList<>();
111112
adminUser = request.getParameter("user");
112113
adminPassword = request.getParameter("password");
114+
ipv6 = Boolean.valueOf(request.getParameter("ipv6"));
113115

114116
// print the domain name in which this server resides in
115117
printDomainName(out);
@@ -278,12 +280,18 @@ private List<String> getServerUrls() {
278280
ServerLifeCycleRuntimeMBean[] serverLifeCycleRuntimes = domainRuntime.getServerLifeCycleRuntimes();
279281
for (ServerLifeCycleRuntimeMBean serverLifeCycleRuntime : serverLifeCycleRuntimes) {
280282
//check state and get the url only if its running, also make sure the url is not null
283+
System.out.println("++++++++START++++++++");
284+
System.out.println("getName():" + serverLifeCycleRuntime.getName());
285+
System.out.println("getType():" + serverLifeCycleRuntime.getType());
286+
System.out.println("getIPv[6]URL(t3):" + serverLifeCycleRuntime.getIPv6URL("t3"));
287+
System.out.println("getIPv[4]URL(t3):" + serverLifeCycleRuntime.getIPv4URL("t3"));
281288
String t3Url =
282-
host.contains(":") ? serverLifeCycleRuntime.getIPv6URL("t3") : serverLifeCycleRuntime.getIPv4URL("t3");
289+
ipv6 ? serverLifeCycleRuntime.getIPv6URL("t3") : serverLifeCycleRuntime.getIPv4URL("t3");
283290
if (t3Url != null && serverLifeCycleRuntime.getState().equals("RUNNING")) {
284291
serverUrls.add(t3Url);
285292
System.out.println("getIPv[4|6]URL(t3):" + t3Url);
286293
}
294+
System.out.println("++++++++END++++++++");
287295
}
288296

289297
return serverUrls;

0 commit comments

Comments
 (0)