1 # test03.sh - test start and stop of the threaded server (-T)
3 # FIXME - this test does not currently pass (H 22-oct-2002)
4 # When the client exits, the process dies with a segfault
8 rm -f idx.log srv.log servercrash
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 -T (threaded)..."
21 ../../index/zebrasrv -T -c zebra1.cfg -l srv.log tcp:@:9901 ||
22 echo "server failed with $?" > servercrash
26 echo " checking that it runs... "
27 test -f zebrasrv.pid || exit 1
28 PID=`cat zebrasrv.pid`
29 ps -p $PID >/dev/null || exit 1
31 echo " connecting to it..."
32 ../testclient localhost:9901 utah > log || exit 1
35 echo " checking that it still runs..."
36 ps -p $PID >/dev/null || exit 1
38 echo " connecting again, with a delay..."
39 ../testclient localhost:9901 utah 5 > log &
40 sleep 1 # let the client connect
46 echo " checking that it is dead"
47 ps -p $PID >/dev/null && exit 1
51 rm -rf reg idx.log srv.log zebrasrv.pid servercrash