More updates to allow tests when builddir != srcdir.
[idzebra-moved-to-github.git] / test / gils / test3.sh
1 #!/bin/sh
2 # $Id: test3.sh,v 1.3 2004-06-15 08:06:34 adam Exp $
3
4 # Testing searches with lots of @and operators
5 # in order to test the fast-forward operation of rsets
6
7 pp=${srcdir:-"."}
8
9 LOG=test3.log
10 DBG="-v 1647"
11
12 rm -f $LOG
13 echo "killing old server (if any)..." >>$LOG
14 test -f zebrasrv.pid && kill `cat zebrasrv.pid`
15 rm -f zebrasrv.pid
16
17 echo  "initializing..." >>$LOG
18 mkdir -p reg
19 ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1
20
21 echo "updating..." >>$LOG
22 ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update records  || exit 1
23
24 echo "starting server..." >>$LOG
25 ../../index/zebrasrv -S -c $pp/zebra1.cfg $DBG -l $LOG tcp:@:9901 &
26 sleep 1
27
28 echo "checking it runs..." >>$LOG
29 test -f zebrasrv.pid || exit 1
30
31 echo "search A1..." >>$LOG
32 ../api/testclient -c 17 localhost:9901 utah > log || exit 1
33
34 echo "search A2..." >>$LOG
35 ../api/testclient -c 30 localhost:9901 the > log || exit 1
36
37 echo "search A3..." >>$LOG
38 ../api/testclient -c 4 localhost:9901 deposits > log || exit 1
39
40
41 echo "search B1..." >>$LOG
42 ../api/testclient -c 7 localhost:9901 "@and utah the" > log || exit 1
43
44 echo "search B2..." >>$LOG
45 ../api/testclient -c 7 localhost:9901 "@and the utah" > log || exit 1
46
47 echo "search C1..." >>$LOG
48 ../api/testclient -c 1 localhost:9901 "@and @and the utah epicenter" > log || exit 1
49
50 echo "search C2..." >>$LOG
51 ../api/testclient -c 1 localhost:9901 "@and @and the epicenter utah" > log || exit 1
52
53 echo "search C3..." >>$LOG
54 ../api/testclient -c 1 localhost:9901 "@and @and utah the epicenter" > log || exit 1
55
56 echo "search C4..." >>$LOG
57 ../api/testclient -c 1 localhost:9901 "@and @and utah epicenter the" > log || exit 1
58
59 echo "search C5..." >>$LOG
60 ../api/testclient -c 1 localhost:9901 "@and @and epicenter the utah" > log || exit 1
61
62 echo "search C6..." >>$LOG
63 ../api/testclient -c 1 localhost:9901 "@and @and epicenter utah the" > log || exit 1
64
65
66 echo "search D1..." >>$LOG
67 ../api/testclient -c 29 localhost:9901 "@and the of "  > log || exit 1
68
69 echo "search D2..." >>$LOG
70 ../api/testclient -c 29 localhost:9901 "@and of the"  > log || exit 1
71
72 echo "search D3..." >>$LOG
73 ../api/testclient -c 29 localhost:9901 "@and @and the of of"  > log || exit 1
74
75 echo "search D4..." >>$LOG
76 ../api/testclient -c 29 localhost:9901 "@and @and of the the"  > log || exit 1
77
78 echo "search D5..." >>$LOG
79 ../api/testclient -c 29 localhost:9901 "@and @and @and the of of the"  > log || exit 1
80
81 echo "search D6..." >>$LOG
82 ../api/testclient -c 15 localhost:9901 '@and @and in the data' > log || exit 1
83
84 echo "search D7..." >>$LOG
85 ../api/testclient -c 15 localhost:9901 '@and @and in data the' > log || exit 1
86
87 echo "search D8..." >>$LOG
88 ../api/testclient -c 2 localhost:9901 "@attr 1=4 @and UNPUBLISHED @and REPORTS AND" >log || exit 1
89 # This one failed at early fast-forwards
90
91 echo "search E1..." >>$LOG
92 ../api/testclient -c 40 localhost:9901 "@or the utah"  > log || exit 1
93
94 echo "search E2..." >>$LOG
95 ../api/testclient -c 40 localhost:9901 "@or utah the"  > log || exit 1
96
97 echo "search E3..." >>$LOG
98 ../api/testclient -c 42 localhost:9901 "@or deposits @or the utah"  > log || exit 1
99
100 echo "search E4..." >>$LOG
101 ../api/testclient -c 2 localhost:9901 "@and deposits @or the utah"  > log || exit 1
102
103 echo "search E5..." >>$LOG
104 ../api/testclient -c 2 localhost:9901 "@and @or the utah deposits"  > log || exit 1
105
106 echo "search F1..." >>$LOG
107 ../api/testclient -c 23 localhost:9901 "@not the utah "  > log || exit 1
108
109 echo "search F2..." >>$LOG
110 ../api/testclient -c 10 localhost:9901 "@not utah the "  > log || exit 1
111
112 echo "search F3..." >>$LOG
113 ../api/testclient -c 1 localhost:9901 "@and deposits @not utah the "  > log || exit 1
114
115 echo "search F4..." >>$LOG
116 ../api/testclient -c 1 localhost:9901 "@and @not utah the deposits"  > log || exit 1
117
118
119 echo "stopping server..." >>$LOG
120 test -f zebrasrv.pid || exit 1
121 kill `cat zebrasrv.pid` || exit 1
122 rm -f zebrasrv.pid
123 sleep 1
124
125 echo "Test successfully completed" >>$LOG
126