From c92773f16fe115a0a398e5e04f3e73873c8383f1 Mon Sep 17 00:00:00 2001 From: Paul Bellamy Date: Mon, 29 Jun 2015 16:30:21 +0100 Subject: [PATCH] working on clustering test --- integration/200_clustering_test.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/integration/200_clustering_test.sh b/integration/200_clustering_test.sh index 7820514b8..f42058632 100644 --- a/integration/200_clustering_test.sh +++ b/integration/200_clustering_test.sh @@ -5,10 +5,20 @@ start_suite "Launch 2 scopes and check they cluster" weave_on $HOST2 launch -container_id=$(start_container $HOST2) +docker_on $HOST2 run -dit --name db1 peterbourgon/tns-db +container_id=$(docker_on $HOST2 run -dit --name app1 --link db1:db1 peterbourgon/tns-app) -scope_on $HOST1 launch -scope_on $HOST2 launch -assert_raises "curl $HOST1:4040/api/topology/containers | grep '$container_id'" +scope_on $HOST1 launch $HOST2 +scope_on $HOST2 launch $HOST1 + +SUCCESS= +for i in {1..10}; do + if (curl $HOST1:4040/api/topology/containers | grep "$container_id" >/dev/null); then + SUCCESS=1 + break + fi + sleep 1 +done +assert "echo $SUCCESS" "1" end_suite