bypassing checks when running make distcheck
[idzebra-moved-to-github.git] / test / gils / stop01.sh
1 #!/bin/sh
2 # $Id: stop01.sh,v 1.12 2006-04-27 10:52:26 marc Exp $
3 # test start and stop of the server with -1
4
5 srcdir=${srcdir:-"."}
6
7 if [ "$srcdir" != "." ]
8     then
9     echo "Jumping over test"
10     exit 0
11 fi
12
13 LOG=stop01.log
14
15 rm -f $LOG
16 echo "initializing" >>$LOG
17 test -d reg || mkdir reg
18 ../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1
19
20 #create a base to test on
21 ../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update records  || exit 1
22
23 echo "Starting server with -1 (one shot)..." >>$LOG
24 ../../index/zebrasrv -D -p z.pid -1 -c $srcdir/zebra1.cfg -l $LOG unix:socket
25 echo "  checking that it runs... " >>$LOG
26 test -f z.pid || exit 1
27 PID=`cat z.pid`
28 kill -CHLD $PID >/dev/null 2>&1 || exit 1
29
30 echo "  connecting to it..." >>$LOG
31 ../api/testclient unix:socket utah >>$LOG || exit 1
32
33 echo "  checking that server does not run any more" >>$LOG
34 kill -CHLD $PID >/dev/null 2>&1 && sleep 1 && \
35 kill -CHLD $PID >/dev/null 2>&1 && exit 1
36
37 # clean up
38 rm -rf reg z.pid