2 # $Id: test3.sh,v 1.9 2006-05-19 13:49:36 adam Exp $
4 # Testing searches with lots of @and operators
5 # in order to test the fast-forward operation of rsets
9 if [ "$srcdir" != "." ]
11 echo "Jumping over test"
20 # these should not be here, will be created later
21 $srcdir/cleanrecords.sh
23 echo "initializing..." >>$LOG
25 ../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg init || exit 1
27 echo "updating..." >>$LOG
28 ../../index/zebraidx -l $LOG -c $srcdir/zebra1.cfg update $srcdir/records || exit 1
30 echo "starting server..." >>$LOG
31 ../../index/zebrasrv -D -p z.pid -S -c $srcdir/zebra1.cfg $DBG -l $LOG unix:socket
33 echo "checking it runs..." >>$LOG
34 test -f z.pid || exit 1
36 echo "search A1..." >>$LOG
37 ../api/testclient -c 17 unix:socket utah > log || exit 1
39 echo "search A2..." >>$LOG
40 ../api/testclient -c 31 unix:socket the > log || exit 1
42 echo "search A3..." >>$LOG
43 ../api/testclient -c 4 unix:socket deposits > log || exit 1
46 echo "search B1..." >>$LOG
47 ../api/testclient -c 7 unix:socket "@and utah the" > log || exit 1
49 echo "search B2..." >>$LOG
50 ../api/testclient -c 7 unix:socket "@and the utah" > log || exit 1
52 echo "search C1..." >>$LOG
53 ../api/testclient -c 1 unix:socket "@and @and the utah epicenter" > log || exit 1
55 echo "search C2..." >>$LOG
56 ../api/testclient -c 1 unix:socket "@and @and the epicenter utah" > log || exit 1
58 echo "search C3..." >>$LOG
59 ../api/testclient -c 1 unix:socket "@and @and utah the epicenter" > log || exit 1
61 echo "search C4..." >>$LOG
62 ../api/testclient -c 1 unix:socket "@and @and utah epicenter the" > log || exit 1
64 echo "search C5..." >>$LOG
65 ../api/testclient -c 1 unix:socket "@and @and epicenter the utah" > log || exit 1
67 echo "search C6..." >>$LOG
68 ../api/testclient -c 1 unix:socket "@and @and epicenter utah the" > log || exit 1
71 echo "search D1..." >>$LOG
72 ../api/testclient -c 30 unix:socket "@and the of " > log || exit 1
74 echo "search D2..." >>$LOG
75 ../api/testclient -c 30 unix:socket "@and of the" > log || exit 1
77 echo "search D3..." >>$LOG
78 ../api/testclient -c 30 unix:socket "@and @and the of of" > log || exit 1
80 echo "search D4..." >>$LOG
81 ../api/testclient -c 30 unix:socket "@and @and of the the" > log || exit 1
83 echo "search D5..." >>$LOG
84 ../api/testclient -c 30 unix:socket "@and @and @and the of of the" > log || exit 1
86 echo "search D6..." >>$LOG
87 ../api/testclient -c 15 unix:socket '@and @and in the data' > log || exit 1
89 echo "search D7..." >>$LOG
90 ../api/testclient -c 15 unix:socket '@and @and in data the' > log || exit 1
92 echo "search D8..." >>$LOG
93 ../api/testclient -c 2 unix:socket "@attr 1=4 @and UNPUBLISHED @and REPORTS AND" >log || exit 1
94 # This one failed at early fast-forwards
96 echo "search E1..." >>$LOG
97 ../api/testclient -c 41 unix:socket "@or the utah" > log || exit 1
99 echo "search E2..." >>$LOG
100 ../api/testclient -c 41 unix:socket "@or utah the" > log || exit 1
102 echo "search E3..." >>$LOG
103 ../api/testclient -c 42 unix:socket "@or deposits @or the utah" > log || exit 1
105 echo "search E4..." >>$LOG
106 ../api/testclient -c 3 unix:socket "@and deposits @or the utah" > log || exit 1
108 echo "search E5..." >>$LOG
109 ../api/testclient -c 3 unix:socket "@and @or the utah deposits" > log || exit 1
111 echo "search F1..." >>$LOG
112 ../api/testclient -c 24 unix:socket "@not the utah " > log || exit 1
114 echo "search F2..." >>$LOG
115 ../api/testclient -c 10 unix:socket "@not utah the " > log || exit 1
117 echo "search F3..." >>$LOG
118 ../api/testclient -c 1 unix:socket "@and deposits @not utah the " > log || exit 1
120 echo "search F4..." >>$LOG
121 ../api/testclient -c 1 unix:socket "@and @not utah the deposits" > log || exit 1
124 echo "stopping server..." >>$LOG
125 test -f z.pid || exit 1
126 kill `cat z.pid` || exit 1
130 echo "Test successfully completed" >>$LOG