Convert tests to programs
[idzebra-moved-to-github.git] / test / xpath / simple1.sh
1 #!/bin/sh
2 # $Id: simple1.sh,v 1.4 2004-06-15 09:43:34 adam Exp $
3 # test with one simple sgml record
4
5 pp=${srcdir:-"."}
6
7 LOG=simple1.log
8 ../../index/zebraidx -c $pp/zebra.cfg -l $LOG init || exit 1
9 ../../index/zebraidx -c $pp/zebra.cfg -l $LOG update $pp/simple1.xml || exit 1
10
11 echo "Starting server " >> $LOG
12 ../../index/zebrasrv -c $pp/zebra.cfg -l $LOG -S unix:socket &
13 sleep 1
14 test -f zebrasrv.pid || exit 2
15
16 ../api/testclient unix:socket -c 0 '@attr 1=/sgml/tag before' >> $LOG || exit 1
17 ../api/testclient unix:socket -c 1 '@attr 1=/sgml/tag inside' >> $LOG || exit 1
18 ../api/testclient unix:socket -c 0 '@attr 1=/sgml/tag after'  >> $LOG || exit 1
19
20 ../api/testclient unix:socket -c 0 '@attr 1=/sgml/none after'  >> $LOG || exit 1
21
22 ../api/testclient unix:socket -c 1 '@attr 1=/sgml before' >> $LOG || exit 1
23 ../api/testclient unix:socket -c 1 '@attr 1=/sgml inside' >> $LOG || exit 1
24 ../api/testclient unix:socket -c 1 '@attr 1=/sgml after'  >> $LOG || exit 1
25
26 echo "killing server " >> $LOG
27 kill `cat zebrasrv.pid` || exit 3
28 echo ok >> $LOG