From: Aki Tuomi Date: Wed, 26 Jun 2013 21:33:37 +0000 (+0300) Subject: Now waits at max 20 seconds for webrick to wake up properly X-Git-Tag: rec-3.6.0-rc1~610^2~2^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee4b86f2ec68ebcaa3db94ec314b256de3531e8e;p=pdns Now waits at max 20 seconds for webrick to wake up properly --- diff --git a/modules/remotebackend/testrunner.sh b/modules/remotebackend/testrunner.sh index 7f687a5ca..3238e7fb9 100755 --- a/modules/remotebackend/testrunner.sh +++ b/modules/remotebackend/testrunner.sh @@ -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