summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaihlavi <l.kaihlavirt@partner.samsung.com>2019-07-30 19:23:52 +0300
committerOfir Sonsino <ofir.sonsino@intl.att.com>2019-08-04 13:24:12 +0000
commit02f48806b4f8e2299cbfb0388b7fb8525d1dcb0a (patch)
treee10c2574c3429cc3308fd445fdc523126b6a54b3
parent061ca938ca6998b4ec33a862c763854259cfeab1 (diff)
Fix test docker readiness check
- add probe_test_docker function to check test docker readiness - minor improvements to docker_run and test docker startup scripts Issue-ID: SDC-2376 Change-Id: If1ee25e8c7850c8e65a520f645ff80c7d5d36373 Signed-off-by: kaihlavi <l.kaihlavirt@partner.samsung.com>
-rwxr-xr-xsdc-os-chef/scripts/docker_run.sh24
-rw-r--r--test-apis-ci/sdc-api-tests/startup.sh11
-rw-r--r--ui-ci/sdc-ui-tests/startup.sh9
3 files changed, 36 insertions, 8 deletions
diff --git a/sdc-os-chef/scripts/docker_run.sh b/sdc-os-chef/scripts/docker_run.sh
index 5e3cd166fc..c3e177adfe 100755
--- a/sdc-os-chef/scripts/docker_run.sh
+++ b/sdc-os-chef/scripts/docker_run.sh
@@ -128,6 +128,20 @@ function probe_docker {
}
#
+function probe_test_docker {
+ # This expected logging should be output by startup.sh of the
+ # respective test docker container
+ MATCH=`docker logs --tail 30 $1 | grep "Startup completed successfully"`
+ echo MATCH is -- ${MATCH}
+
+ if [ -n "$MATCH" ] ; then
+ echo TEST DOCKER start finished in $2 seconds
+ return ${SUCCESS}
+ fi
+ return ${FAILURE}
+}
+#
+
function probe_es {
health_Check_http_code=$(curl --noproxy "*" -o /dev/null -w '%{http_code}' http://${IP}:9200/_cluster/health?wait_for_status=yellow&timeout=120s)
@@ -173,7 +187,7 @@ function monitor_docker {
status=$? ;
;;
sdc-BE)
- ready_probe ${DOCKER_NAME} ${TIME} ;
+ ready_probe ${DOCKER_NAME} ${TIME} ;
status=$? ;
;;
sdc-FE)
@@ -184,6 +198,14 @@ function monitor_docker {
ready_probe ${DOCKER_NAME} ${TIME} ;
status=$? ;
;;
+ sdc-api-tests)
+ probe_test_docker ${DOCKER_NAME} ${TIME};
+ status=$? ;
+ ;;
+ sdc-ui-tests)
+ probe_test_docker ${DOCKER_NAME} ${TIME};
+ status=$? ;
+ ;;
*)
probe_docker ${DOCKER_NAME} ${TIME};
status=$? ;
diff --git a/test-apis-ci/sdc-api-tests/startup.sh b/test-apis-ci/sdc-api-tests/startup.sh
index 349741c353..80faeeac2e 100644
--- a/test-apis-ci/sdc-api-tests/startup.sh
+++ b/test-apis-ci/sdc-api-tests/startup.sh
@@ -6,9 +6,12 @@ chef-solo -c solo.rb -E ${ENVNAME}
rc=$?
if [[ $rc != 0 ]]; then
- echo "Sanity failed !!!"
+ echo "Startup failed !!!"
exit $rc
else
- echo "completed successfully :-)"
- exit 0
-fi \ No newline at end of file
+# Note that the output below is monitored in CSIT by
+# sdc/sdc-os-chef/scripts/docker_run.sh
+# If this text is changed, docker_run.sh check for sdc-api-tests docker
+# startup must be adjusted accordingly!
+ echo "Startup completed successfully"
+fi
diff --git a/ui-ci/sdc-ui-tests/startup.sh b/ui-ci/sdc-ui-tests/startup.sh
index 4700e68fee..9078980666 100644
--- a/ui-ci/sdc-ui-tests/startup.sh
+++ b/ui-ci/sdc-ui-tests/startup.sh
@@ -8,9 +8,12 @@ chef-solo -c solo.rb -E ${ENVNAME}
rc=$?
if [[ $rc != 0 ]]; then
- echo "Sanity failed !!!"
+ echo "Startup failed !!!"
exit $rc
else
- echo "completed successfully :-)"
-# exit 0
+# Note that the output below is monitored in CSIT by
+# sdc/sdc-os-chef/scripts/docker_run.sh
+# If this text is changed, docker_run.sh check for sdc-ui-tests docker
+# startup must be adjusted accordingly!
+ echo "Startup completed successfully"
fi