]> granicus.if.org Git - pdns/commitdiff
Now waits at max 20 seconds for webrick to wake up properly
authorAki Tuomi <cmouse@desteem.org>
Wed, 26 Jun 2013 21:33:37 +0000 (00:33 +0300)
committerAki Tuomi <cmouse@desteem.org>
Thu, 27 Jun 2013 08:42:47 +0000 (11:42 +0300)
modules/remotebackend/testrunner.sh

index 7f687a5cafa99cb9a27e56faab66c8f1457ddfff..3238e7fb996a36d266a460ac60f1fa59c55fab98 100755 (executable)
@@ -6,7 +6,13 @@ function start_web() {
   if [ x"$REMOTEBACKEND_HTTP" == "xyes" ]; then
    ./unittest_$1.rb &
    webrick_pid=$!
-   sleep 1
+   loopcount=0
+   while [ $loopcount -lt 20 ]; do
+     res=$(curl http://localhost:62434/ping 2>/dev/null)
+     if [ "x$res" == "xpong" ]; then break; fi
+     sleep 1
+     let loopcount=loopcount+1
+   done
   fi
 }
 
@@ -50,7 +56,7 @@ case "$mode" in
     stop_web
   ;;
   *)
-     echo "Usage: $0 test_remotebackend_(pipe|http|post)"
+     echo "Usage: $0 test_remotebackend_(pipe|http|post|json)"
   ;;
 esac