aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislav Chlebec <stanislav.chlebec@pantheon.tech>2018-12-03 18:06:21 +0100
committerStanislav Chlebec <stanislav.chlebec@pantheon.tech>2018-12-03 21:28:09 +0100
commitd3c71b158a799285d2f356ceccb446d33e156520 (patch)
tree82a3d18cf5743592738e80a0f1c357a1e87d4629
parent558fabbcf916392fdb46b7a264b7fd19442db0fb (diff)
run test only if container is healthy
Only for the test dmaap-datarouter/dr-suite Change-Id: I0eb9ce624bb15b69b8bec90212f30c8af97af290 Signed-off-by: Stanislav Chlebec <stanislav.chlebec@pantheon.tech> Issue-ID: DMAAP-580
-rwxr-xr-xplans/dmaap-datarouter/dr-suite/setup.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/plans/dmaap-datarouter/dr-suite/setup.sh b/plans/dmaap-datarouter/dr-suite/setup.sh
index dedf15b0..22d727a7 100755
--- a/plans/dmaap-datarouter/dr-suite/setup.sh
+++ b/plans/dmaap-datarouter/dr-suite/setup.sh
@@ -30,6 +30,27 @@ for i in {1..10}; do
fi
done
+# Wait for healthy container datarouter-prov
+for i in {1..10}; do
+ if [ "$(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov)" = 'healthy' ]
+ then
+ echo datarouter-prov.State.Health.Status is $(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov)
+ echo "DR Service Running, datarouter-prov container is healthy"
+ break
+ else
+ echo datarouter-prov.State.Health.Status is $(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov)
+ echo sleep $i
+ sleep $i
+ if [ $i = 10 ]
+ then
+ echo datarouter-prov container is not in healthy state - the test is not made, teardown...
+ cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources
+ docker-compose down -v
+ exit 1
+ fi
+ fi
+done
+
DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-prov)
DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-node)
DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov)