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