From af8aad211786393c3505c7649cc18c88195b8f45 Mon Sep 17 00:00:00 2001 From: ehautot Date: Fri, 23 Feb 2018 12:36:37 +0100 Subject: Fix clamp integration APIs due to code change Change-Id: I6537143329a8bd16c7648a07d5a00fb76d0d8130 Signed-off-by: ehautot Issue-ID: CLAMP-100 --- test/csit/scripts/clamp/start_clamp_containers.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/csit/scripts/clamp/start_clamp_containers.sh') diff --git a/test/csit/scripts/clamp/start_clamp_containers.sh b/test/csit/scripts/clamp/start_clamp_containers.sh index 02abe264c..e49a591dd 100755 --- a/test/csit/scripts/clamp/start_clamp_containers.sh +++ b/test/csit/scripts/clamp/start_clamp_containers.sh @@ -48,3 +48,21 @@ if [ "$TIME" -ge "$TIME_OUT" ]; then echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for tests... fi +# To avoid some problem because templates not yet read +TIME=0 +while [ "$TIME" -lt "$TIME_OUT" ]; do + response=$(curl --write-out '%{http_code}' --silent --output /dev/null -u admin:5f4dcc3b5aa765d61d8327deb882cf99 http://localhost:8080/restservices/clds/v1/cldsTempate/template-names); echo $response + + if [ "$response" == "200" ]; then + echo Templates well available + break; + fi + + echo Sleep: $INTERVAL seconds before testing if templates available. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds + sleep $INTERVAL + TIME=$(($TIME+$INTERVAL)) +done + +if [ "$TIME" -ge "$TIME_OUT" ]; then + echo TIME OUT: Templates not available in $TIME_OUT seconds... Could cause problems for tests... +fi -- cgit 1.2.3-korg