Wait for service to be listening before running tests 59/114459/1
authorTodd Malsbary <todd.malsbary@intel.com>
Tue, 20 Oct 2020 21:40:37 +0000 (14:40 -0700)
committerTodd Malsbary <todd.malsbary@intel.com>
Fri, 30 Oct 2020 23:32:45 +0000 (16:32 -0700)
Issue-ID: MULTICLOUD-1242
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I5aa45daf92ebfbee32d154dc17f7d2afd72bf255

deployments/_functions.sh
deployments/start.sh

index 4707443..c0feed0 100755 (executable)
@@ -34,3 +34,14 @@ EOF
 function start_all {
     docker-compose up -d
 }
+
+function wait_for_service {
+    for try in {0..59}; do
+        echo "$(date +%H:%M:%S) - Waiting for service up"
+        sleep 1
+        if $(curl http://localhost:9015/v1 &>/dev/null); then
+            return 0
+        fi
+    done
+    exit 1
+}
index e7ff133..61af504 100755 (executable)
@@ -21,3 +21,4 @@ stop_all
 start_mongo
 generate_k8sconfig
 start_all
+wait_for_service