2 # $Id: stop02.sh,v 1.3 2003-05-06 20:09:28 adam Exp $
3 # test start and stop of the server with -S
5 # FIXME - this test does not currently pass (H 22-oct-2002)
6 # Something rotten with signals and threads and mutexes...
11 ../../index/zebraidx -l idx.log -c zebra1.cfg init || exit 1
13 #create a base to test on
14 ../../index/zebraidx -l idx.log -c zebra1.cfg update records || exit 1
16 #kill old server (if any)
17 test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid`
21 echo "Starting server with -S (static)..."
22 ../../index/zebrasrv -S -c zebra1.cfg -l srv.log tcp:@:9901 &
25 echo " checking that it runs... "
26 test -f zebrasrv.pid || exit 1
27 PID=`cat zebrasrv.pid`
28 ps -p $PID |grep $PID >/dev/null || exit 1
30 echo " connecting to it..."
31 ../testclient localhost:9901 utah > log || exit 1
34 echo " checking that it still runs..."
35 ps -p $PID | grep $PID >/dev/null || exit 1
37 echo " connecting again, with a delay..."
38 ../testclient -d 5 localhost:9901 utah > log &
39 sleep 1 # let the client connect
45 echo " checking that it is dead..."
46 ps -p $PID | grep $PID >/dev/null && exit 1
49 rm -rf reg idx.log srv.log zebrasrv.pid