X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fgils%2Fstop02.sh;h=e3052942127cbea5bbabe21ed61ee91625299cd7;hb=85ad68ab178a261dc548284ee68aae9107cbfaaf;hp=d6216bf1148bbcaad1ff74f10270400094aaa48b;hpb=965edd26d5f3cb170e8a02fee134bc19c9c615f4;p=idzebra-moved-to-github.git diff --git a/test/gils/stop02.sh b/test/gils/stop02.sh index d6216bf..e305294 100755 --- a/test/gils/stop02.sh +++ b/test/gils/stop02.sh @@ -1,48 +1,48 @@ #!/bin/sh -# $Id: stop02.sh,v 1.6 2004-06-14 23:45:11 adam Exp $ # test start and stop of the server with -S -pp=${srcdir:-"."} +srcdir=${srcdir:-"."} + +if [ "$srcdir" != "." ] + then + echo "Jumping over test" + exit 0 +fi LOG=stop02.log rm -f $LOG echo "initializing" >>$LOG -mkdir -p reg -../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1 +test -d reg || mkdir reg +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1 #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` +../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update records || exit 1 echo "Starting server with -S (static)..." >>$LOG -../../index/zebrasrv -S -c $pp/zebra1.cfg -l $LOG tcp:@:9901 & -sleep 1 - +../../index/zebrasrv -D -p z.pid -S -c $srcdir/zebra1.cfg -l $LOG unix:socket echo " checking that it runs... " >>$LOG -test -f zebrasrv.pid || exit 1 -PID=`cat zebrasrv.pid` -ps -p $PID |grep $PID >/dev/null || exit 1 +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 +../api/testclient unix:socket 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 -d 5 localhost:9901 utah >>$LOG & +../api/testclient -d 5 unix:socket utah >>$LOG & sleep 1 # let the client connect echo " killing it..." >>$LOG kill $PID -sleep 1 echo " checking that it is dead..." >>$LOG -ps -p $PID | grep $PID >/dev/null && exit 1 +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