X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fgils%2Fstop02.sh;h=37a20db09491d991c74f02e451fbe3d1f0d5ed81;hb=339db25a87b77481458e80a2b932f7161fe597c6;hp=d9de69277df761758493978e6b78cab5bb551125;hpb=e93e9d110b6bb2596e011de5fb0c8825ac2fe2b2;p=idzebra-moved-to-github.git diff --git a/test/gils/stop02.sh b/test/gils/stop02.sh index d9de692..37a20db 100755 --- a/test/gils/stop02.sh +++ b/test/gils/stop02.sh @@ -1,50 +1,43 @@ #!/bin/sh -# $Id: stop02.sh,v 1.2 2003-05-06 17:39:01 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 -# -# FIXME - this test does not currently pass (H 22-oct-2002) -# Something rotten with signals and threads and mutexes... -echo "initializing" -mkdir -p reg -rm -f idx.log srv.log -../../index/zebraidx -l idx.log -c zebra1.cfg init || exit 1 +pp=${srcdir:-"."} -#create a base to test on -../../index/zebraidx -l idx.log -c zebra1.cfg update records || exit 1 +LOG=stop02.log -#kill old server (if any) -test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid` -rm -f zebrasrv.pid -rm -f srv.log +rm -f $LOG +echo "initializing" >>$LOG +test -d reg || mkdir reg +../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1 -echo "Starting server with -S (static)..." -../../index/zebrasrv -S -c zebra1.cfg -l srv.log tcp:@:9901 & -sleep 1 +#create a base to test on +../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records || exit 1 -echo " checking that it runs... " -test -f zebrasrv.pid || exit 1 -PID=`cat zebrasrv.pid` -ps -p $PID >/dev/null || exit 1 +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 +PID=`cat z.pid` +kill -CHLD $PID >/dev/null 2>&1 || exit 1 -echo " connecting to it..." -../testclient localhost:9901 utah > log || exit 1 +echo " connecting to it..." >>$LOG +../api/testclient unix:socket utah >>$LOG || exit 1 sleep 1 -echo " checking that it still runs..." -ps -p $PID >/dev/null || exit 1 +echo " checking that it still runs..." >>$LOG +kill -CHLD $PID >/dev/null 2>&1 || exit 1 -echo " connecting again, with a delay..." -../testclient -d 5 localhost:9901 utah > log & +echo " connecting again, with a delay..." >>$LOG +../api/testclient -d 5 unix:socket utah >>$LOG & sleep 1 # let the client connect -echo " killing it..." -kill $PID +echo " killing it..." >>$LOG +kill $PID -sleep 1 -echo " checking that it is dead..." -ps -p $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 -echo ok # clean up -rm -rf reg idx.log srv.log zebrasrv.pid +rm -rf reg z.pid