2 # $Id: stop01.sh,v 1.7 2004-09-24 15:03:19 adam Exp $
3 # test start and stop of the server with -1
10 echo "initializing" >>$LOG
12 ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1
14 #create a base to test on
15 ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records || exit 1
17 #kill old server (if any)
18 test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid`
20 echo "Starting server with -1 (one shot)..." >>$LOG
21 ../../index/zebrasrv -1 -c $pp/zebra1.cfg -l $LOG tcp:@:9901 &
23 echo " checking that it runs... " >>$LOG
24 test -f zebrasrv.pid || sleep 5 || 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..." >>$LOG
29 ../api/testclient localhost:9901 utah >>$LOG || exit 1
32 echo " checking that server does not run any more" >>$LOG
33 ps -p $PID | grep $PID >/dev/null && exit 1
36 rm -rf reg zebrasrv.pid