From c5b5b96946bfc3ed7e50348bacb1035a8740b339 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Thu, 27 Jun 2013 11:44:58 +0300 Subject: [PATCH] Make sure webrick is running before testing --- modules/remotebackend/regression-tests/http-backend.rb | 1 + regression-tests/start-test-stop | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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 a75f38e7ec..a7f1735e46 100755 --- a/regression-tests/start-test-stop +++ b/regression-tests/start-test-stop @@ -511,7 +511,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" -- 2.47.2