2 # test start and stop of the server with -S
6 if [ "$srcdir" != "." ]
8 echo "Jumping over test"
15 echo "initializing" >>$LOG
16 test -d reg || mkdir reg
17 ../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1
19 #create a base to test on
20 ../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update records || exit 1
22 echo "Starting server with -S (static)..." >>$LOG
23 ../../index/zebrasrv -D -p z.pid -S -c $srcdir/zebra1.cfg -l $LOG unix:socket
24 echo " checking that it runs... " >>$LOG
25 test -f z.pid || exit 1
27 kill -CHLD $PID >/dev/null 2>&1 || exit 1
29 echo " connecting to it..." >>$LOG
30 ../api/testclient unix:socket utah >>$LOG || exit 1
33 echo " checking that it still runs..." >>$LOG
34 kill -CHLD $PID >/dev/null 2>&1 || exit 1
36 echo " connecting again, with a delay..." >>$LOG
37 ../api/testclient -d 5 unix:socket utah >>$LOG &
38 sleep 1 # let the client connect
40 echo " killing it..." >>$LOG
43 echo " checking that it is dead..." >>$LOG
44 kill -CHLD $PID >/dev/null 2>&1 && sleep 1 && \
45 kill -CHLD $PID >/dev/null 2>&1 && exit 1