Convert tests to programs
[idzebra-moved-to-github.git] / test / xpath / test3.sh
1 #!/bin/sh
2 # $Id: test3.sh,v 1.5 2004-06-15 09:43:34 adam Exp $
3
4 pp=${srcdir:-"."}
5
6 LOG=test3.log
7 TMP=test3.tmp
8 rm -f $LOG
9 rm -f $TMP
10 ../../index/zebraidx -c $pp/zebra.cfg -l $LOG init || exit 1
11 ../../index/zebraidx -c $pp/zebra.cfg -l $LOG -t grs.sgml update $pp/rec.xml || exit 2
12 test -f dict*.mf || exit 1
13 ../../index/zebrasrv -c $pp/zebra.cfg -l $LOG -S unix:socket & 
14 sleep 1
15 test -f zebrasrv.pid || exit 2
16 ../api/testclient unix:socket '@attr 1=/Zthes/relation/termName Sauropoda' >$TMP
17 echo 'Killing server' >>$LOG
18 kill `cat zebrasrv.pid` || exit 3
19 cat $TMP >>$LOG
20 echo 'Checking that result count is 1' >>$LOG
21 grep "^Result count: 1$" $TMP >/dev/null || exit 4
22 echo 'Test OK' >>$LOG
23