51
51
import static oracle .weblogic .kubernetes .utils .ApplicationUtils .callWebAppAndWaitTillReturnedCode ;
52
52
import static oracle .weblogic .kubernetes .utils .CommonMiiTestUtils .createSSLenabledMiiDomainAndVerify ;
53
53
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getHostAndPort ;
54
+ import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getServiceExtIPAddrtOke ;
54
55
import static oracle .weblogic .kubernetes .utils .LoadBalancerUtils .createIngressAndRetryIfFail ;
55
56
import static oracle .weblogic .kubernetes .utils .LoadBalancerUtils .installAndVerifyNginx ;
56
57
import static oracle .weblogic .kubernetes .utils .LoadBalancerUtils .installAndVerifyTraefik ;
78
79
@ IntegrationTest
79
80
@ DisabledOnSlimImage
80
81
@ Tag ("olcne" )
81
- @ Tag ("oke-parallel" )
82
82
@ Tag ("kind-parallel" )
83
83
@ Tag ("okd-wls-mrg" )
84
+ @ Tag ("oke-gate" )
84
85
class ItRemoteConsole {
85
86
86
87
private static String domainNamespace = null ;
@@ -214,7 +215,11 @@ void testWlsRemoteConsoleConnectionUsingSSL() {
214
215
int sslPort = getServicePort (
215
216
domainNamespace , getExternalServicePodName (adminServerPodName ), "default-secure" );
216
217
setTargetPortForRoute ("domain1-admin-server-sslport-ext" , domainNamespace , sslPort );
217
- String hostAndPort = getHostAndPort (adminSvcSslPortExtHost , sslNodePort );
218
+ String ingressServiceName = traefikHelmParams .getReleaseName ();
219
+ String hostAndPort = getServiceExtIPAddrtOke (ingressServiceName , traefikNamespace ) != null
220
+ ? getServiceExtIPAddrtOke (ingressServiceName , traefikNamespace )
221
+ : getHostAndPort (adminSvcSslPortExtHost , sslNodePort );
222
+
218
223
logger .info ("The hostAndPort is {0}" , hostAndPort );
219
224
220
225
//verify WebLogic console is accessible through default-secure nodeport
@@ -242,7 +247,6 @@ void testWlsRemoteConsoleConnectionUsingSSL() {
242
247
logger .info ("Executing remote console default-secure nodeport curl command {0}" , curlCmd );
243
248
assertTrue (callWebAppAndWaitTillReturnedCode (curlCmd , "201" , 10 ), "Calling web app failed" );
244
249
logger .info ("Remote console is accessible through default-secure service" );
245
-
246
250
}
247
251
248
252
/**
@@ -323,7 +327,10 @@ private static void createNginxIngressPathRoutingRules() {
323
327
String nginxServiceName = nginxHelmParams .getHelmParams ().getReleaseName () + "-ingress-nginx-controller" ;
324
328
nginxNodePort = assertDoesNotThrow (() -> getServiceNodePort (nginxNamespace , nginxServiceName , "http" ),
325
329
"Getting Nginx loadbalancer service node port failed" );
326
- String curlCmd = "curl --silent --show-error --noproxy '*' http://" + K8S_NODEPORT_HOST + ":" + nginxNodePort
330
+ String hostAndPort = getServiceExtIPAddrtOke (nginxServiceName , nginxNamespace ) != null
331
+ ? getServiceExtIPAddrtOke (nginxServiceName , nginxNamespace ) : K8S_NODEPORT_HOST + ":" + nginxNodePort ;
332
+
333
+ String curlCmd = "curl --silent --show-error --noproxy '*' http://" + hostAndPort
327
334
+ "/weblogic/ready --write-out %{http_code} -o /dev/null" ;
328
335
329
336
logger .info ("Executing curl command {0}" , curlCmd );
@@ -344,10 +351,6 @@ private static void verifyWlsRemoteConsoleConnection() {
344
351
logger .info ("admin svc host = {0}" , adminSvcExtHost );
345
352
String hostAndPort = getHostAndPort (adminSvcExtHost , nodePort );
346
353
347
- //The final complete curl command to run is like:
348
- //curl -v --show-error --user username:password http://localhost:8012/api/providers/AdminServerConnection -H
349
- //"Content-Type:application/json" --data "{ \"name\": \"asconn\", \"domainUrl\": \"http://myhost://nodeport\"}"
350
- //--write-out %{http_code} -o /dev/null
351
354
String curlCmd = "curl -v --show-error --noproxy '*' --user "
352
355
+ ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT
353
356
+ " http://localhost:8012/api/providers/AdminServerConnection -H "
@@ -366,17 +369,18 @@ private static void verifyRemoteConsoleConnectionThroughLB(int nodePortOfLB) {
366
369
logger .info ("LB nodePort is {0}" , nodePortOfLB );
367
370
logger .info ("The K8S_NODEPORT_HOST is {0}" , K8S_NODEPORT_HOST );
368
371
369
- //The final complete curl command to run is like:
370
- //curl -v --user username:password http://localhost:8012/api/providers/AdminServerConnection -H
371
- //"Content-Type:application/json" --data "{ \"name\": \"asconn\", \"domainUrl\": \"http://myhost://nodeport\"}"
372
- //--write-out %{http_code} -o /dev/null
372
+ String ingressServiceName = traefikHelmParams .getReleaseName ();
373
+ String traefikNamespace = traefikHelmParams .getNamespace ();
374
+ String hostAndPort = getServiceExtIPAddrtOke (ingressServiceName , traefikNamespace ) != null
375
+ ? getServiceExtIPAddrtOke (ingressServiceName , traefikNamespace ) : K8S_NODEPORT_HOST + ":" + nodePortOfLB ;
376
+
373
377
String curlCmd = "curl -v --user " + ADMIN_USERNAME_DEFAULT + ":" + ADMIN_PASSWORD_DEFAULT
374
378
+ " http://localhost:8012/api/providers/AdminServerConnection -H "
375
379
+ "\" " + "Content-Type:application/json" + "\" "
376
380
+ " --data "
377
381
+ "\" { \\ " + "\" name\\ " + "\" " + ": " + "\\ " + "\" " + "asconn\\ " + "\" " + ", "
378
382
+ "\\ " + "\" " + "domainUrl\\ " + "\" " + ": " + "\\ " + "\" " + "http://"
379
- + K8S_NODEPORT_HOST + ":" + nodePortOfLB + "\\ " + "\" }" + "\" "
383
+ + hostAndPort + "\\ " + "\" }" + "\" "
380
384
+ " --write-out %{http_code} -o /dev/null" ;
381
385
logger .info ("Executing LB nodeport curl command {0}" , curlCmd );
382
386
assertTrue (callWebAppAndWaitTillReturnedCode (curlCmd , "201" , 10 ),
0 commit comments