2 # $Id: test1.sh,v 1.13 2005-01-03 12:08:04 adam Exp $
9 echo "initializing..." >>$LOG
10 test -d reg || mkdir reg
11 rm -f $pp/records/esdd000[12].grs # these should not be here, will be created later
12 ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1
14 echo "updating..." >>$LOG
15 ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update $pp/records || exit 1
17 echo "starting server..." >>$LOG
18 ../../index/zebrasrv -D -p z.pid -S -c $pp/zebra1.cfg -l $LOG unix:socket
20 echo "checking it runs..." >>$LOG
21 test -f z.pid || exit 1
23 echo "search 1..." >>$LOG
24 ../api/testclient unix:socket utah > log || exit 1
25 grep "^Result count: 17$" log >/dev/null || exit 1
27 echo "search 2..." >>$LOG
28 ../api/testclient unix:socket "@or utah the" > log || exit 1
29 grep "^Result count: 40$" log >/dev/null || exit 1
31 echo "search 3..." >>$LOG
32 ../api/testclient unix:socket "@attr 1=4 the" > log || exit 1
33 grep "^Result count: 1$" log >/dev/null || exit 1
35 echo "search 4..." >>$LOG
36 ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1
37 grep "^Result count: 9$" log >/dev/null || exit 1
39 echo "reindexing..." >>$LOG
40 ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update $pp/records || exit 1
42 echo "search 5..." >>$LOG
43 ../api/testclient unix:socket "@attr 1=4 utah" > log || exit 1
44 grep "^Result count: 18$" log >/dev/null || exit 1
46 echo "stopping server..." >>$LOG
47 test -f z.pid || exit 1
48 kill `cat z.pid` || exit 1