2 # $Id: stop03.sh,v 1.2 2003-05-06 17:39:01 adam Exp $
3 # test start and stop of the threaded server (-T)
5 # FIXME - this test does not currently pass (H 22-oct-2002)
6 # When the client exits, the process dies with a segfault
10 rm -f idx.log srv.log servercrash
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 -T (threaded)..."
23 ../../index/zebrasrv -T -c zebra1.cfg -l srv.log tcp:@:9901 ||
24 echo "server failed with $?" > servercrash
28 echo " checking that it runs... "
29 test -f zebrasrv.pid || exit 1
30 PID=`cat zebrasrv.pid`
31 ps -p $PID >/dev/null || exit 1
33 echo " connecting to it..."
34 ../testclient localhost:9901 utah > log || exit 1
37 echo " checking that it still runs..."
38 ps -p $PID >/dev/null || exit 1
40 echo " connecting again, with a delay..."
41 ../testclient localhost:9901 utah 5 > log &
42 sleep 1 # let the client connect
48 echo " checking that it is dead"
49 ps -p $PID >/dev/null && exit 1
53 rm -rf reg idx.log srv.log zebrasrv.pid servercrash