@@ -286,9 +286,13 @@ public void verifyAdminServerExternalService(String username, String password) t
286
286
*
287
287
* @param protocol
288
288
* @param port
289
+ * @param path
289
290
* @throws Exception
290
291
*/
291
- public void verifyHasClusterServiceChannelPort (String protocol , int port ) throws Exception {
292
+ public void verifyHasClusterServiceChannelPort (String protocol , int port , String path )
293
+ throws Exception {
294
+
295
+ /* Make sure the service exists in k8s */
292
296
if (!TestUtils .checkHasServiceChannelPort (
293
297
this .getDomainUid () + "-cluster-" + this .clusterName , domainNS , protocol , port )) {
294
298
throw new RuntimeException (
@@ -297,6 +301,35 @@ public void verifyHasClusterServiceChannelPort(String protocol, int port) throws
297
301
+ "/"
298
302
+ protocol );
299
303
}
304
+
305
+ /* Make sure we can reach the port */
306
+ StringBuffer testAppUrl = new StringBuffer ("http://" );
307
+ testAppUrl
308
+ .append (this .getDomainUid () + "-cluster-" + this .clusterName )
309
+ .append (":" )
310
+ .append (port )
311
+ .append ("/" );
312
+ testAppUrl .append (path );
313
+ // curl cmd to call webapp
314
+ StringBuffer curlCmd =
315
+ new StringBuffer (
316
+ "kubectl exec " + this .getDomainUid () + "-" + this .adminServerName + " /usr/bin/curl " );
317
+ curlCmd .append (testAppUrl .toString ());
318
+
319
+ // curl cmd to get response code
320
+ StringBuffer curlCmdResCode = new StringBuffer (curlCmd .toString ());
321
+ // -- means pass trailing args to command in exec, not exec itself
322
+ curlCmdResCode .append (" -- --write-out %{http_code} -o /dev/null" );
323
+
324
+ logger .info ("Curl cmd with response code " + curlCmdResCode );
325
+ logger .info ("Curl cmd " + curlCmd );
326
+
327
+ // call webapp iteratively till its deployed/ready
328
+ callWebAppAndWaitTillReady (curlCmdResCode .toString ());
329
+
330
+ // execute curl and look for the managed server name in response
331
+ callWebAppAndCheckForServerNameInResponse (curlCmd .toString (), true );
332
+ logger .info ("curlCmd " + curlCmd );
300
333
}
301
334
302
335
/**
@@ -435,8 +468,8 @@ public void callWebAppAndVerifyLoadBalancing(String webappName, boolean verifyLo
435
468
StringBuffer curlCmdResCode = new StringBuffer (curlCmd .toString ());
436
469
curlCmdResCode .append (" --write-out %{http_code} -o /dev/null" );
437
470
438
- logger .info ("Curd cmd with response code " + curlCmdResCode );
439
- logger .info ("Curd cmd " + curlCmd );
471
+ logger .info ("Curl cmd with response code " + curlCmdResCode );
472
+ logger .info ("Curl cmd " + curlCmd );
440
473
441
474
// call webapp iteratively till its deployed/ready
442
475
callWebAppAndWaitTillReady (curlCmdResCode .toString ());
0 commit comments