5 if [ "$srcdir" != "." ]
7 echo "Jumping over test"
15 echo "initializing..." >>$LOG
16 test -d reg || mkdir reg
18 # these should not be here, will be created later
19 $srcdir/cleanrecords.sh
20 #if [ -f $srcdir/records/esdd0001.grs ]
22 # rm -f $srcdir/records/esdd0001.grs
24 #if [ -f $srcdir/records/esdd0002.grs ]
26 # rm -f $srcdir/records/esdd0002.grs
29 ../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1
31 echo "updating..." >>$LOG
32 ../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update $srcdir/records || exit 1
34 echo "starting server..." >>$LOG
35 ../../index/zebrasrv -D -p z.pid -S -c $srcdir/zebra1.cfg -l $LOG unix:socket
37 echo "checking it runs..." >>$LOG
38 test -f z.pid || exit 1
40 echo "search 1..." >>$LOG
41 ../api/testclient unix:socket utah > log || exit 1
42 grep "^Result count: 17$" log >/dev/null || exit 1
44 echo "search 2..." >>$LOG
45 ../api/testclient unix:socket "@or utah the" > log || exit 1
46 grep "^Result count: 41$" log >/dev/null || exit 1
48 echo "search 3..." >>$LOG
49 ../api/testclient unix:socket "@attr 1=4 the" > log || exit 1
50 grep "^Result count: 1$" log >/dev/null || exit 1
52 echo "search 4..." >>$LOG
53 ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1
54 grep "^Result count: 9$" log >/dev/null || exit 1
56 echo "reindexing..." >>$LOG
57 ../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update $srcdir/records || exit 1
59 echo "search 5..." >>$LOG
60 ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1
61 grep "^Result count: 18$" log >/dev/null || exit 1
63 echo "stopping server..." >>$LOG
64 test -f z.pid || exit 1
65 kill `cat z.pid` || exit 1