From 339db25a87b77481458e80a2b932f7161fe597c6 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sun, 2 Jan 2005 23:21:31 +0000 Subject: [PATCH] Use YAZ GFS PID file instead of zebrasrv.pid --- test/gils/stop01.sh | 5 +---- test/gils/stop02.sh | 5 +---- test/gils/stop03.sh | 30 ++++++++++++------------------ test/gils/stop04.sh | 23 +++++++++++------------ test/gils/test1.sh | 15 ++++++--------- test/gils/test2.sh | 14 +++++++------- test/gils/test3.sh | 15 ++++++--------- test/gils/timing1.sh | 15 ++++++--------- test/gils/timing2.sh | 15 ++++++--------- 9 files changed, 56 insertions(+), 81 deletions(-) diff --git a/test/gils/stop01.sh b/test/gils/stop01.sh index caf714b..edaf28e 100755 --- a/test/gils/stop01.sh +++ b/test/gils/stop01.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: stop01.sh,v 1.9 2004-12-04 01:48:26 adam Exp $ +# $Id: stop01.sh,v 1.10 2005-01-02 23:21:31 adam Exp $ # test start and stop of the server with -1 pp=${srcdir:-"."} @@ -14,9 +14,6 @@ test -d reg || mkdir reg #create a base to test on ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records || exit 1 -#kill old server (if any) -test -f z.pid && kill -9 `cat z.pid` - 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 diff --git a/test/gils/stop02.sh b/test/gils/stop02.sh index 889cf8c..37a20db 100755 --- a/test/gils/stop02.sh +++ b/test/gils/stop02.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: stop02.sh,v 1.9 2004-12-04 01:48:26 adam Exp $ +# $Id: stop02.sh,v 1.10 2005-01-02 23:21:31 adam Exp $ # test start and stop of the server with -S pp=${srcdir:-"."} @@ -14,9 +14,6 @@ test -d reg || mkdir reg #create a base to test on ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records || exit 1 -#kill old server (if any) -test -f z.pid && kill -9 `cat z.pid` - 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 diff --git a/test/gils/stop03.sh b/test/gils/stop03.sh index e2ab9fc..3b8cbe7 100755 --- a/test/gils/stop03.sh +++ b/test/gils/stop03.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: stop03.sh,v 1.8 2004-09-24 15:03:19 adam Exp $ +# $Id: stop03.sh,v 1.9 2005-01-02 23:21:31 adam Exp $ # test start and stop of the threaded server (-T) pp=${srcdir:-"."} @@ -14,31 +14,24 @@ mkdir -p reg #create a base to test on ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records || exit 1 -#kill old server (if any) -test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid` - echo "Starting server with -T (threaded)..." >>$LOG -( - ../../index/zebrasrv -T -c $pp/zebra1.cfg -l $LOG tcp:@:9901 2>out || - echo "server failed with $?" > $LOG -)& -sleep 1 +../../index/zebrasrv -D -p z.pid -T -c $pp/zebra1.cfg -l $LOG tcp:@:9901 2>out if grep 'not available' out >/dev/null; then - test -f zebrasrv.pid && rm zebrasrv.pid + test -f z.pid && rm -f z.pid exit 0 fi -echo " checking that it runs... " >>$LOG -test -f zebrasrv.pid || sleep 5 || test -f zebrasrv.pid || exit 1 -PID=`cat zebrasrv.pid` -ps -p $PID | grep $PID >/dev/null || exit 1 + +PID=`cat z.pid` +echo " checking that it still runs..." >>$LOG +kill -CHLD $PID >/dev/null 2>&1 || exit 1 echo " connecting to it..." >>$LOG ../api/testclient localhost:9901 utah >>$LOG || exit 1 sleep 1 echo " checking that it still runs..." >>$LOG -ps -p $PID >/dev/null || exit 1 +kill -CHLD $PID >/dev/null 2>&1 || exit 1 echo " connecting again, with a delay..." >>$LOG ../api/testclient localhost:9901 utah 5 >>$LOG & @@ -48,8 +41,9 @@ echo " killing it..." >>$LOG kill $PID sleep 1 -echo " checking that it is dead" >>$LOG -ps -p $PID | grep $PID >/dev/null && exit 1 +echo " checking that it is dead..." >>$LOG +kill -CHLD $PID >/dev/null 2>&1 && sleep 1 && \ +kill -CHLD $PID >/dev/null 2>&1 && exit 1 # clean up -rm -rf reg zebrasrv.pid +rm -rf reg z.pid diff --git a/test/gils/stop04.sh b/test/gils/stop04.sh index 11bfd7b..356afec 100755 --- a/test/gils/stop04.sh +++ b/test/gils/stop04.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: stop04.sh,v 1.7 2004-09-24 15:03:19 adam Exp $ +# $Id: stop04.sh,v 1.8 2005-01-02 23:21:31 adam Exp $ # test start and stop of the forked server pp=${srcdir:-"."} @@ -14,24 +14,21 @@ mkdir -p reg #create a base to test on ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records || exit 1 -#kill old server (if any) -test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid` - echo "Starting server with (forked)..." >>$LOG -../../index/zebrasrv -c $pp/zebra1.cfg -l $LOG tcp:@:9901 & +../../index/zebrasrv -D -p z.pid -c $pp/zebra1.cfg -l $LOG tcp:@:9901 sleep 1 echo " checking that it runs... " >>$LOG -test -f zebrasrv.pid || sleep 5 || test -f zebrasrv.pid || exit 1 -PID=`cat zebrasrv.pid` -ps -p $PID | grep $PID >/dev/null || exit 1 +test -f z.pid || sleep 5 || test -f z.pid || exit 1 +PID=`cat z.pid` +kill -CHLD $PID >/dev/null 2>&1 || exit 1 echo " connecting to it..." >>$LOG ../api/testclient localhost:9901 utah >>$LOG || exit 1 sleep 1 echo " checking that it still runs..." >>$LOG -ps -p $PID | grep $PID >/dev/null || exit 1 +kill -CHLD $PID >/dev/null 2>&1 || exit 1 echo " connecting again, with a delay..." >>$LOG ../api/testclient localhost:9901 utah 5 >>$LOG @@ -41,8 +38,10 @@ echo " killing it..." >>$LOG kill $PID sleep 1 -echo " checking that the server is dead..." >>$LOG -ps -p $PID | grep $PID >/dev/null && exit 1 +echo " checking that it is dead..." >>$LOG +kill -CHLD $PID >/dev/null 2>&1 && sleep 1 && \ +kill -CHLD $PID >/dev/null 2>&1 && exit 1 + # clean up -rm -rf reg zebrasrv.pid +rm -rf reg z.pid diff --git a/test/gils/test1.sh b/test/gils/test1.sh index 682ed78..666284f 100755 --- a/test/gils/test1.sh +++ b/test/gils/test1.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: test1.sh,v 1.10 2004-09-24 15:03:19 adam Exp $ +# $Id: test1.sh,v 1.11 2005-01-02 23:21:31 adam Exp $ pp=${srcdir:-"."} @@ -14,15 +14,12 @@ rm -f $pp/records/esdd000[12].grs # these should not be here, will be created la echo "updating..." >>$LOG ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update $pp/records || exit 1 -echo "killing old server (if any)..." >>$LOG -test -f zebrasrv.pid && kill `cat zebrasrv.pid` - echo "starting server..." >>$LOG -../../index/zebrasrv -S -c $pp/zebra1.cfg -l $LOG tcp:@:9901 & +../../index/zebrasrv -D -p z.pid -S -c $pp/zebra1.cfg -l $LOG tcp:@:9901 sleep 1 echo "checking it runs..." >>$LOG -test -f zebrasrv.pid || sleep 5 || test -f zebrasrv.pid || exit 1 +test -f z.pid || sleep 5 || test -f z.pid || exit 1 echo "search 1..." >>$LOG ../api/testclient localhost:9901 utah > log || exit 1 @@ -48,7 +45,7 @@ echo "search 5..." >>$LOG grep "^Result count: 18$" log >/dev/null || exit 1 echo "stopping server..." >>$LOG -test -f zebrasrv.pid || exit 1 -kill `cat zebrasrv.pid` || exit 1 -rm -f zebrasrv.pid +test -f z.pid || exit 1 +kill `cat z.pid` || exit 1 +rm -f z.pid diff --git a/test/gils/test2.sh b/test/gils/test2.sh index c99e171..8a13039 100755 --- a/test/gils/test2.sh +++ b/test/gils/test2.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: test2.sh,v 1.10 2004-09-24 15:03:19 adam Exp $ +# $Id: test2.sh,v 1.11 2005-01-02 23:21:31 adam Exp $ pp=${srcdir:-"."} @@ -17,12 +17,12 @@ echo "update 2..." >>$LOG ../../index/zebraidx -l $LOG -c $pp/zebra2.cfg update $pp/records || exit 1 echo "killing old server (if any)..." >>$LOG -test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid` +test -f z.pid && kill -9 `cat z.pid` echo "starting server..." >>$LOG -../../index/zebrasrv -S -c $pp/zebra2.cfg -l $LOG tcp:@:9901 & +../../index/zebrasrv -D -p z.pid -S -c $pp/zebra2.cfg -l $LOG tcp:@:9901 sleep 1 -test -f zebrasrv.pid || sleep 5 || test -f zebrasrv.pid || exit 1 +test -f z.pid || sleep 5 || test -f z.pid || exit 1 echo "search 1..." >>$LOG ../api/testclient localhost:9901 "@attr 1=4 utah" > log || exit 1 @@ -81,8 +81,8 @@ echo "search 7..." >>$LOG grep "^Result count: 1$" log >/dev/null || exit 1 echo "stopping server..." >>$LOG -test -f zebrasrv.pid || exit 1 -kill `cat zebrasrv.pid` || exit 1 +test -f z.pid || exit 1 +kill `cat z.pid` || exit 1 rm -f log rm -f $pp/records/esdd000[12].grs -rm -f zebrasrv.pid +rm -f z.pid diff --git a/test/gils/test3.sh b/test/gils/test3.sh index e8bfbb0..04eb3d7 100755 --- a/test/gils/test3.sh +++ b/test/gils/test3.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: test3.sh,v 1.4 2004-06-15 09:43:30 adam Exp $ +# $Id: test3.sh,v 1.5 2005-01-02 23:21:31 adam Exp $ # Testing searches with lots of @and operators # in order to test the fast-forward operation of rsets @@ -10,9 +10,6 @@ LOG=test3.log DBG="-v 1647" rm -f $LOG -echo "killing old server (if any)..." >>$LOG -test -f zebrasrv.pid && kill `cat zebrasrv.pid` -rm -f zebrasrv.pid echo "initializing..." >>$LOG mkdir -p reg @@ -22,11 +19,11 @@ echo "updating..." >>$LOG ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update $pp/records || exit 1 echo "starting server..." >>$LOG -../../index/zebrasrv -S -c $pp/zebra1.cfg $DBG -l $LOG tcp:@:9901 & +../../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 zebrasrv.pid || exit 1 +test -f z.pid || exit 1 echo "search A1..." >>$LOG ../api/testclient -c 17 localhost:9901 utah > log || exit 1 @@ -117,9 +114,9 @@ echo "search F4..." >>$LOG echo "stopping server..." >>$LOG -test -f zebrasrv.pid || exit 1 -kill `cat zebrasrv.pid` || exit 1 -rm -f zebrasrv.pid +test -f z.pid || exit 1 +kill `cat z.pid` || exit 1 +rm -f z.pid sleep 1 echo "Test successfully completed" >>$LOG diff --git a/test/gils/timing1.sh b/test/gils/timing1.sh index b59b876..a394281 100755 --- a/test/gils/timing1.sh +++ b/test/gils/timing1.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: timing1.sh,v 1.9 2004-06-15 09:43:30 adam Exp $ +# $Id: timing1.sh,v 1.10 2005-01-02 23:21:31 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 @@ -14,13 +14,10 @@ echo " init..." >>$LOG rm -f $pp/records/esdd000[12].grs # these should not be here, will be created later ../../index/zebraidx -c $pp/zebra2.cfg -l $LOG init || exit 1 -echo " killing old server (if any)..." >>$LOG -test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid` - echo " starting server..." >>$LOG -../../index/zebrasrv -S -c $pp/zebra2.cfg -l $LOG tcp:@:9901 & +../../index/zebrasrv -D -p z.pid -S -c $pp/zebra2.cfg -l $LOG tcp:@:9901 sleep 1 -test -f zebrasrv.pid || exit 1 +test -f z.pid || exit 1 sleep 2 echo " update 1..." >>$LOG @@ -131,9 +128,9 @@ echo " checking..." >>$LOG grep "^Result count: 10$" log >/dev/null || exit 1 echo "stopping server..." >>$LOG -test -f zebrasrv.pid || exit 1 -kill `cat zebrasrv.pid` || exit 1 +test -f z.pid || exit 1 +kill `cat z.pid` || exit 1 rm -f log rm -f $pp/records/esdd000[12].grs -rm -f zebrasrv.pid +rm -f z.pid diff --git a/test/gils/timing2.sh b/test/gils/timing2.sh index e34b1c2..ddbd0fa 100755 --- a/test/gils/timing2.sh +++ b/test/gils/timing2.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: timing2.sh,v 1.9 2004-06-15 09:43:30 adam Exp $ +# $Id: timing2.sh,v 1.10 2005-01-02 23:21:31 adam Exp $ # Demonstrated that updates depend on file timestamps pp=${srcdir:-"."} @@ -14,13 +14,10 @@ rm -f $pp/records/esdd000[12].grs # these should not be here, will be created la ../../index/zebraidx -c $pp/zebra2.cfg -l $LOG init || exit 1 touch timeref1 # make an early timestamp -echo " killing old server (if any)..." >>$LOG -test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid` - echo " starting server..." >>$LOG -../../index/zebrasrv -S -c $pp/zebra2.cfg -l $LOG tcp:@:9901 & +../../index/zebrasrv -D -p z.pid -S -c $pp/zebra2.cfg -l $LOG tcp:@:9901 sleep 1 -test -f zebrasrv.pid || exit 1 +test -f z.pid || exit 1 touch timeref2 # make a later timestamp echo " update 1..." >>$LOG @@ -66,9 +63,9 @@ echo " checking..." >>$LOG grep "^Result count: 9$" log >/dev/null || exit 1 echo "stopping server..." >>$LOG -test -f zebrasrv.pid || exit 1 -kill `cat zebrasrv.pid` || exit 1 +test -f z.pid || exit 1 +kill `cat z.pid` || exit 1 rm -f log timeref[12] rm -f $pp/records/esdd000[12].grs -rm -f zebrasrv.pid +rm -f z.pid -- 1.7.10.4