From 6cc6c9be5dd96693ad594072f6a7c16bd59e4a78 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 3 Jan 2005 09:19:26 +0000 Subject: [PATCH] Assume PID file has been created just after server has started --- test/gils/stop01.sh | 4 ++-- test/gils/stop02.sh | 4 ++-- test/gils/stop03.sh | 5 ++++- test/gils/stop04.sh | 5 ++--- test/gils/test1.sh | 5 ++--- test/gils/test2.sh | 5 ++--- test/gils/test3.sh | 3 +-- test/gils/timing1.sh | 3 +-- test/gils/timing2.sh | 4 ++-- 9 files changed, 18 insertions(+), 20 deletions(-) diff --git a/test/gils/stop01.sh b/test/gils/stop01.sh index edaf28e..97083b5 100755 --- a/test/gils/stop01.sh +++ b/test/gils/stop01.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: stop01.sh,v 1.10 2005-01-02 23:21:31 adam Exp $ +# $Id: stop01.sh,v 1.11 2005-01-03 09:19:26 adam Exp $ # test start and stop of the server with -1 pp=${srcdir:-"."} @@ -17,7 +17,7 @@ test -d reg || mkdir reg echo "Starting server with -1 (one shot)..." >>$LOG ../../index/zebrasrv -D -p z.pid -1 -c $pp/zebra1.cfg -l $LOG unix:socket echo " checking that it runs... " >>$LOG -test -f z.pid || sleep 1 || test -f z.pid || exit 1 +test -f z.pid || exit 1 PID=`cat z.pid` kill -CHLD $PID >/dev/null 2>&1 || exit 1 diff --git a/test/gils/stop02.sh b/test/gils/stop02.sh index 37a20db..3fc821e 100755 --- a/test/gils/stop02.sh +++ b/test/gils/stop02.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: stop02.sh,v 1.10 2005-01-02 23:21:31 adam Exp $ +# $Id: stop02.sh,v 1.11 2005-01-03 09:19:26 adam Exp $ # test start and stop of the server with -S pp=${srcdir:-"."} @@ -17,7 +17,7 @@ test -d reg || mkdir reg echo "Starting server with -S (static)..." >>$LOG ../../index/zebrasrv -D -p z.pid -S -c $pp/zebra1.cfg -l $LOG unix:socket echo " checking that it runs... " >>$LOG -test -f z.pid || sleep 1 || test -f z.pid || exit 1 +test -f z.pid || exit 1 PID=`cat z.pid` kill -CHLD $PID >/dev/null 2>&1 || exit 1 diff --git a/test/gils/stop03.sh b/test/gils/stop03.sh index 3b8cbe7..8523036 100755 --- a/test/gils/stop03.sh +++ b/test/gils/stop03.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: stop03.sh,v 1.9 2005-01-02 23:21:31 adam Exp $ +# $Id: stop03.sh,v 1.10 2005-01-03 09:19:26 adam Exp $ # test start and stop of the threaded server (-T) pp=${srcdir:-"."} @@ -22,6 +22,9 @@ if grep 'not available' out >/dev/null; then exit 0 fi +echo " checking that it runs..." >>$LOG +test -f z.pid || exit 1 + PID=`cat z.pid` echo " checking that it still runs..." >>$LOG kill -CHLD $PID >/dev/null 2>&1 || exit 1 diff --git a/test/gils/stop04.sh b/test/gils/stop04.sh index 356afec..f6e74ed 100755 --- a/test/gils/stop04.sh +++ b/test/gils/stop04.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: stop04.sh,v 1.8 2005-01-02 23:21:31 adam Exp $ +# $Id: stop04.sh,v 1.9 2005-01-03 09:19:26 adam Exp $ # test start and stop of the forked server pp=${srcdir:-"."} @@ -16,10 +16,9 @@ mkdir -p reg echo "Starting server with (forked)..." >>$LOG ../../index/zebrasrv -D -p z.pid -c $pp/zebra1.cfg -l $LOG tcp:@:9901 -sleep 1 echo " checking that it runs... " >>$LOG -test -f z.pid || sleep 5 || test -f z.pid || exit 1 +test -f z.pid || exit 1 PID=`cat z.pid` kill -CHLD $PID >/dev/null 2>&1 || exit 1 diff --git a/test/gils/test1.sh b/test/gils/test1.sh index 666284f..a96014b 100755 --- a/test/gils/test1.sh +++ b/test/gils/test1.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: test1.sh,v 1.11 2005-01-02 23:21:31 adam Exp $ +# $Id: test1.sh,v 1.12 2005-01-03 09:19:26 adam Exp $ pp=${srcdir:-"."} @@ -16,10 +16,9 @@ echo "updating..." >>$LOG echo "starting server..." >>$LOG ../../index/zebrasrv -D -p z.pid -S -c $pp/zebra1.cfg -l $LOG tcp:@:9901 -sleep 1 echo "checking it runs..." >>$LOG -test -f z.pid || sleep 5 || test -f z.pid || exit 1 +test -f z.pid || exit 1 echo "search 1..." >>$LOG ../api/testclient localhost:9901 utah > log || exit 1 diff --git a/test/gils/test2.sh b/test/gils/test2.sh index 8a13039..cb568ae 100755 --- a/test/gils/test2.sh +++ b/test/gils/test2.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: test2.sh,v 1.11 2005-01-02 23:21:31 adam Exp $ +# $Id: test2.sh,v 1.12 2005-01-03 09:19:26 adam Exp $ pp=${srcdir:-"."} @@ -21,8 +21,7 @@ test -f z.pid && kill -9 `cat z.pid` echo "starting server..." >>$LOG ../../index/zebrasrv -D -p z.pid -S -c $pp/zebra2.cfg -l $LOG tcp:@:9901 -sleep 1 -test -f z.pid || sleep 5 || test -f z.pid || exit 1 +test -f z.pid || exit 1 echo "search 1..." >>$LOG ../api/testclient localhost:9901 "@attr 1=4 utah" > log || exit 1 diff --git a/test/gils/test3.sh b/test/gils/test3.sh index 04eb3d7..c315aa8 100755 --- a/test/gils/test3.sh +++ b/test/gils/test3.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: test3.sh,v 1.5 2005-01-02 23:21:31 adam Exp $ +# $Id: test3.sh,v 1.6 2005-01-03 09:19:26 adam Exp $ # Testing searches with lots of @and operators # in order to test the fast-forward operation of rsets @@ -20,7 +20,6 @@ echo "updating..." >>$LOG echo "starting server..." >>$LOG ../../index/zebrasrv -D -p z.pid -S -c $pp/zebra1.cfg $DBG -l $LOG tcp:@:9901 -sleep 1 echo "checking it runs..." >>$LOG test -f z.pid || exit 1 diff --git a/test/gils/timing1.sh b/test/gils/timing1.sh index a394281..311b5d8 100755 --- a/test/gils/timing1.sh +++ b/test/gils/timing1.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: timing1.sh,v 1.10 2005-01-02 23:21:31 adam Exp $ +# $Id: timing1.sh,v 1.11 2005-01-03 09:19:26 adam Exp $ # tests that updates are reflected immediately # in the registers. # Repeatedly modifies a record and counts hits. # Test 1: with good sleeps in every between - should pass always @@ -16,7 +16,6 @@ rm -f $pp/records/esdd000[12].grs # these should not be here, will be created la echo " starting server..." >>$LOG ../../index/zebrasrv -D -p z.pid -S -c $pp/zebra2.cfg -l $LOG tcp:@:9901 -sleep 1 test -f z.pid || exit 1 sleep 2 diff --git a/test/gils/timing2.sh b/test/gils/timing2.sh index ddbd0fa..daa1b0a 100755 --- a/test/gils/timing2.sh +++ b/test/gils/timing2.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: timing2.sh,v 1.10 2005-01-02 23:21:31 adam Exp $ +# $Id: timing2.sh,v 1.11 2005-01-03 09:19:26 adam Exp $ # Demonstrated that updates depend on file timestamps pp=${srcdir:-"."} @@ -16,8 +16,8 @@ touch timeref1 # make an early timestamp echo " starting server..." >>$LOG ../../index/zebrasrv -D -p z.pid -S -c $pp/zebra2.cfg -l $LOG tcp:@:9901 -sleep 1 test -f z.pid || exit 1 +sleep 1 touch timeref2 # make a later timestamp echo " update 1..." >>$LOG -- 1.7.10.4