Permalink
Browse files

Make sure webrick is running before testing

  • Loading branch information...
1 parent 9a319b1 commit 44c2ee81040851f8c5f63219369d90031848b89d @cmouse cmouse committed with Habbie Jun 27, 2013
Showing with 8 additions and 1 deletion.
  1. +1 −0 modules/remotebackend/regression-tests/http-backend.rb
  2. +7 −1 regression-tests/start-test-stop
@@ -14,6 +14,7 @@
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 }
@@ -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"

0 comments on commit 44c2ee8

Please sign in to comment.