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