2 # $Id: stop04.sh,v 1.4 2003-05-21 14:39:22 adam Exp $
3 # test start and stop of the forked server
9 ../../index/zebraidx -l idx.log -c zebra1.cfg init || exit 1
11 #create a base to test on
12 ../../index/zebraidx -l idx.log -c zebra1.cfg update records || exit 1
14 #kill old server (if any)
15 test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid`
19 echo "Starting server with (forked)..."
20 ../../index/zebrasrv -c zebra1.cfg -l srv.log tcp:@:9901 &
23 echo " checking that it runs... "
24 test -f zebrasrv.pid || exit 1
25 PID=`cat zebrasrv.pid`
26 ps -p $PID | grep $PID >/dev/null || exit 1
28 echo " connecting to it..."
29 ../api/testclient localhost:9901 utah > log || exit 1
32 echo " checking that it still runs..."
33 ps -p $PID | grep $PID >/dev/null || exit 1
35 echo " connecting again, with a delay..."
36 ../api/testclient localhost:9901 utah 5 > log &
37 sleep 1 # let the client connect
43 echo " checking that the server is dead..."
44 ps -p $PID | grep $PID >/dev/null && exit 1
47 rm -rf reg idx.log srv.log zebrasrv.pid