Skip to content

Commit 2d703d7

Browse files
committed
moved wsbalancing test to advanced tests, added more checks for deploy
1 parent 75562cd commit 2d703d7

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/BaseTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ public void testDomainLifecyle(Operator operator, Domain domain) throws Exceptio
358358
} else {
359359
domain.verifyWebAppLoadBalancing(TESTWEBAPP);
360360
}
361+
testWSLoadBalancing(domain);
361362
domain.verifyAdminServerExternalService(getUsername(), getPassword());
362363
domain.verifyHasClusterServiceChannelPort("TCP", 8011, TESTWEBAPP + "/");
363364
logger.info("Done - testDomainLifecyle");

integration-tests/src/test/java/oracle/kubernetes/operator/ITUsabilityOperatorHelmChart.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,6 @@ private Domain createVerifyDomain(int number, Operator operator) throws Exceptio
721721
Domain domain = TestUtils.createDomain(TestUtils.createDomainMap(number));
722722
domain.verifyDomainCreated();
723723
testAdminT3Channel(domain);
724-
testWSLoadBalancing(domain);
725724
TestUtils.renewK8sClusterLease(getProjectRoot(), getLeaseId());
726725
logger.info("verify that domain is managed by operator");
727726
operator.verifyDomainExists(domain.getDomainUid());

integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,15 +1222,16 @@ public static void buildDeployWebServiceAppInPod(
12221222
String archiveExt = "war";
12231223
String infoDirName = initInfoDirName;
12241224
String domainNS = domain.getDomainNS();
1225+
String managedServerPort = (String) domain.getDomainMap().get("managedServerPort");
12251226
String wsServiceName = (args.length == 0) ? BaseTest.TESTWSSERVICE : args[0];
12261227
String clusterDNS =
12271228
domain.getDomainUid()
12281229
+ "-cluster-"
12291230
+ domain.getClusterName()
12301231
+ "."
12311232
+ domainNS
1232-
+ ".svc.cluster.local:8001";
1233-
1233+
+ ".svc.cluster.local:"
1234+
+ managedServerPort;
12341235
logger.info(
12351236
"Build and deploy WebService App: "
12361237
+ appName

integration-tests/src/test/resources/apps/buildDeployWSAndWSClientAppInPod.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,23 @@ cp ${APP_DIR_INPOD}/buildfiles/${WS_NAME}.war ${APP_DIR_INPOD}/.
5252
cp ${APP_DIR_INPOD}/buildfiles/${WS_NAME}Servlet.war ${APP_DIR_INPOD}/.
5353

5454
echo "Deploy ${APP_NAME} using curl:"
55-
echo -e "curl --noproxy '*' --silent --user ${USER}:${PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:multipart/form-data -F \"model={ name: '${APP_NAME}', targets: [ { identity: [ clusters, '${DEPLOY_TARGET}' ] } ] }\" -F \"sourcePath=@${ARCHIVE_FILE_WS}\" -H \"Prefer:respond-async\" -X POST http://${HOST}:${PORT}/management/weblogic/latest/edit/appDeployments\n"
56-
curl --noproxy '*' --silent --user ${USER}:${PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:multipart/form-data -F "model={ name: '${APP_NAME}', targets: [ { identity: [ clusters, '${DEPLOY_TARGET}' ] } ] }" -F "sourcePath=@${ARCHIVE_FILE_WS}" -H "Prefer:respond-async" -X POST http://${HOST}:${PORT}/management/weblogic/latest/edit/appDeployments
55+
echo -e "curl --noproxy '*' --silent --user ${USER}:${PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:multipart/form-data -F \"model={ name: '${APP_NAME}', targets: [ { identity: [ clusters, '${DEPLOY_TARGET}' ] } ] }\" -F \"sourcePath=@${ARCHIVE_FILE_WS}\" -H \"Prefer:respond-async\" -X POST http://${HOST}:${PORT}/management/weblogic/latest/edit/appDeployments -o ${APP_DIR_INPOD}/deployWS.out\n"
56+
curl --noproxy '*' --silent --user ${USER}:${PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:multipart/form-data -F "model={ name: '${APP_NAME}', targets: [ { identity: [ clusters, '${DEPLOY_TARGET}' ] } ] }" -F "sourcePath=@${ARCHIVE_FILE_WS}" -H "Prefer:respond-async" -X POST http://${HOST}:${PORT}/management/weblogic/latest/edit/appDeployments -o ${APP_DIR_INPOD}/deployWS.out
5757
sleep 10
58+
grep -q "STATE_RUNNING" ${APP_DIR_INPOD}/deployWS.out
59+
cres=$?
60+
[[ $cres != 0 ]] && echo "[FAIL] Unable to deploy wsapp ..."
61+
[[ $cres == 0 ]] && echo "[SUCCESS] wsapp is deployed ..."
5862

5963
echo "Deploy ${APP_NAME}Servlet using curl:"
60-
echo -e "curl --noproxy '*' --silent --user ${USER}:${PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:multipart/form-data -F \"model={ name: '${APP_NAME}servlet', targets: [ { identity: [ clusters, '${DEPLOY_TARGET}' ] } ] }\" -F \"sourcePath=@${ARCHIVE_FILE_SERVLET}\" -H \"Prefer:respond-async\" -X POST http://${HOST}:${PORT}/management/weblogic/latest/edit/appDeployments\n"
61-
curl --noproxy '*' --silent --user ${USER}:${PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:multipart/form-data -F "model={ name: '${APP_NAME}servlet', targets: [ { identity: [ clusters, '${DEPLOY_TARGET}' ] } ] }" -F "sourcePath=@${ARCHIVE_FILE_SERVLET}" -H "Prefer:respond-async" -X POST http://${HOST}:${PORT}/management/weblogic/latest/edit/appDeployments
64+
echo -e "curl --noproxy '*' --silent --user ${USER}:${PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:multipart/form-data -F \"model={ name: '${APP_NAME}servlet', targets: [ { identity: [ clusters, '${DEPLOY_TARGET}' ] } ] }\" -F \"sourcePath=@${ARCHIVE_FILE_SERVLET}\" -H \"Prefer:respond-async\" -X POST http://${HOST}:${PORT}/management/weblogic/latest/edit/appDeployments -o ${APP_DIR_INPOD}/deployWSServlet.out\n"
65+
curl --noproxy '*' --silent --user ${USER}:${PASSWORD} -H X-Requested-By:MyClient -H Accept:application/json -H Content-Type:multipart/form-data -F "model={ name: '${APP_NAME}servlet', targets: [ { identity: [ clusters, '${DEPLOY_TARGET}' ] } ] }" -F "sourcePath=@${ARCHIVE_FILE_SERVLET}" -H "Prefer:respond-async" -X POST http://${HOST}:${PORT}/management/weblogic/latest/edit/appDeployments -o ${APP_DIR_INPOD}/deployWSServlet.out
66+
sleep 10
67+
grep -q "STATE_RUNNING" ${APP_DIR_INPOD}/deployWSServlet.out
68+
cres=$?
69+
[[ $cres != 0 ]] && echo "[FAIL] Unable to deploy wsclientapp ..."
70+
[[ $cres == 0 ]] && echo "[SUCCESS] wsclientapp is deployed ..."
71+
6272

6373
rm -rf ${APP_DIR_INPOD}/buildfiles
6474

0 commit comments

Comments
 (0)