Assume PID file has been created just after server has started
[idzebra-moved-to-github.git] / test / gils / test3.sh
1 #!/bin/sh
2 # $Id: test3.sh,v 1.6 2005-01-03 09:19:26 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
14 echo  "initializing..." >>$LOG
15 mkdir -p reg
16 ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg init || exit 1
17
18 echo "updating..." >>$LOG
19 ../../index/zebraidx -l $LOG -c $pp/zebra1.cfg update $pp/records  || exit 1
20
21 echo "starting server..." >>$LOG
22 ../../index/zebrasrv -D -p z.pid -S -c $pp/zebra1.cfg $DBG -l $LOG tcp:@:9901
23
24 echo "checking it runs..." >>$LOG
25 test -f z.pid || exit 1
26
27 echo "search A1..." >>$LOG
28 ../api/testclient -c 17 localhost:9901 utah > log || exit 1
29
30 echo "search A2..." >>$LOG
31 ../api/testclient -c 30 localhost:9901 the > log || exit 1
32
33 echo "search A3..." >>$LOG
34 ../api/testclient -c 4 localhost:9901 deposits > log || exit 1
35
36
37 echo "search B1..." >>$LOG
38 ../api/testclient -c 7 localhost:9901 "@and utah the" > log || exit 1
39
40 echo "search B2..." >>$LOG
41 ../api/testclient -c 7 localhost:9901 "@and the utah" > log || exit 1
42
43 echo "search C1..." >>$LOG
44 ../api/testclient -c 1 localhost:9901 "@and @and the utah epicenter" > log || exit 1
45
46 echo "search C2..." >>$LOG
47 ../api/testclient -c 1 localhost:9901 "@and @and the epicenter utah" > log || exit 1
48
49 echo "search C3..." >>$LOG
50 ../api/testclient -c 1 localhost:9901 "@and @and utah the epicenter" > log || exit 1
51
52 echo "search C4..." >>$LOG
53 ../api/testclient -c 1 localhost:9901 "@and @and utah epicenter the" > log || exit 1
54
55 echo "search C5..." >>$LOG
56 ../api/testclient -c 1 localhost:9901 "@and @and epicenter the utah" > log || exit 1
57
58 echo "search C6..." >>$LOG
59 ../api/testclient -c 1 localhost:9901 "@and @and epicenter utah the" > log || exit 1
60
61
62 echo "search D1..." >>$LOG
63 ../api/testclient -c 29 localhost:9901 "@and the of "  > log || exit 1
64
65 echo "search D2..." >>$LOG
66 ../api/testclient -c 29 localhost:9901 "@and of the"  > log || exit 1
67
68 echo "search D3..." >>$LOG
69 ../api/testclient -c 29 localhost:9901 "@and @and the of of"  > log || exit 1
70
71 echo "search D4..." >>$LOG
72 ../api/testclient -c 29 localhost:9901 "@and @and of the the"  > log || exit 1
73
74 echo "search D5..." >>$LOG
75 ../api/testclient -c 29 localhost:9901 "@and @and @and the of of the"  > log || exit 1
76
77 echo "search D6..." >>$LOG
78 ../api/testclient -c 15 localhost:9901 '@and @and in the data' > log || exit 1
79
80 echo "search D7..." >>$LOG
81 ../api/testclient -c 15 localhost:9901 '@and @and in data the' > log || exit 1
82
83 echo "search D8..." >>$LOG
84 ../api/testclient -c 2 localhost:9901 "@attr 1=4 @and UNPUBLISHED @and REPORTS AND" >log || exit 1
85 # This one failed at early fast-forwards
86
87 echo "search E1..." >>$LOG
88 ../api/testclient -c 40 localhost:9901 "@or the utah"  > log || exit 1
89
90 echo "search E2..." >>$LOG
91 ../api/testclient -c 40 localhost:9901 "@or utah the"  > log || exit 1
92
93 echo "search E3..." >>$LOG
94 ../api/testclient -c 42 localhost:9901 "@or deposits @or the utah"  > log || exit 1
95
96 echo "search E4..." >>$LOG
97 ../api/testclient -c 2 localhost:9901 "@and deposits @or the utah"  > log || exit 1
98
99 echo "search E5..." >>$LOG
100 ../api/testclient -c 2 localhost:9901 "@and @or the utah deposits"  > log || exit 1
101
102 echo "search F1..." >>$LOG
103 ../api/testclient -c 23 localhost:9901 "@not the utah "  > log || exit 1
104
105 echo "search F2..." >>$LOG
106 ../api/testclient -c 10 localhost:9901 "@not utah the "  > log || exit 1
107
108 echo "search F3..." >>$LOG
109 ../api/testclient -c 1 localhost:9901 "@and deposits @not utah the "  > log || exit 1
110
111 echo "search F4..." >>$LOG
112 ../api/testclient -c 1 localhost:9901 "@and @not utah the deposits"  > log || exit 1
113
114
115 echo "stopping server..." >>$LOG
116 test -f z.pid || exit 1
117 kill `cat z.pid` || exit 1
118 rm -f z.pid
119 sleep 1
120
121 echo "Test successfully completed" >>$LOG
122