From: Aki Tuomi Date: Thu, 27 Jun 2013 08:44:58 +0000 (+0300) Subject: Make sure webrick is running before testing X-Git-Tag: auth-3.3~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44c2ee81040851f8c5f63219369d90031848b89d;p=thirdparty%2Fpdns.git Make sure webrick is running before testing --- diff --git a/modules/remotebackend/regression-tests/http-backend.rb b/modules/remotebackend/regression-tests/http-backend.rb index 8be678a877..6581a12fbb 100755 --- a/modules/remotebackend/regression-tests/http-backend.rb +++ b/modules/remotebackend/regression-tests/http-backend.rb @@ -14,6 +14,7 @@ server = WEBrick::HTTPServer.new( be = Handler.new("../modules/remotebackend/regression-tests/remote.sqlite3") server.mount "/dns", DNSBackendHandler, be +server.mount_proc("/ping"){ |req,resp| resp.body = "pong" } trap('INT') { server.stop } trap('TERM') { server.stop } diff --git a/regression-tests/start-test-stop b/regression-tests/start-test-stop index 108a618bf1..f6e3731471 100755 --- a/regression-tests/start-test-stop +++ b/regression-tests/start-test-stop @@ -470,7 +470,13 @@ __EOF__ $testsdir/http-backend.rb & echo $! > pdns-remotebackend.pid # make sure it runs before continuing - sleep 2 + 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 ;; unix) connstr="unix:path=/tmp/remote.socket"