2 # 2: Test without sleeps, fails around step 1a or 1b.
4 echo "Testing timings of updates"
7 rm -f records/esdd000[12].grs # these should not be here, will be created later
8 ../../index/zebraidx -l idx.log init || exit 1
10 echo " killing old server (if any)..."
11 test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid`
15 echo " starting server..."
16 ../../index/zebrasrv -S -c zebra2.cfg -l srv.log tcp:@:9901 &
18 test -f zebrasrv.pid || exit 1
21 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
24 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
25 grep "^Result count: 9$" log || exit 1
27 echo "making a test record..."
28 cp records/esdd0006.grs records/esdd0002.grs
30 echo " indexing it..."
31 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
34 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
35 grep "^Result count: 10$" log || exit 1
36 echo " 1a: modifying a test record (xyz)..."
37 sed 's/UTAH/XYZ/g' <records/esdd0002.grs >records/esdd0002x.grs
38 mv records/esdd0002x.grs records/esdd0002.grs
40 echo " indexing it..."
41 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
44 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
46 grep "^Result count: 9$" log || exit 1
48 echo " 1b: modifying the test record back (utah)..."
49 sed 's/XYZ/UTAH/g' <records/esdd0002.grs >records/esdd0002x.grs
50 mv records/esdd0002x.grs records/esdd0002.grs
52 echo " indexing it..."
53 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
56 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
58 grep "^Result count: 10$" log || exit 1
60 echo " 2a: modifying the test record (xyz)..."
61 sed 's/UTAH/XYZ/g' <records/esdd0002.grs >records/esdd0002x.grs
62 mv records/esdd0002x.grs records/esdd0002.grs
64 echo " indexing it..."
65 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
68 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
70 grep "^Result count: 9$" log || exit 1
72 echo " 2b: modifying the test record back (utah)..."
73 sed 's/XYZ/UTAH/g' <records/esdd0002.grs >records/esdd0002x.grs
74 mv records/esdd0002x.grs records/esdd0002.grs
76 echo " indexing it..."
77 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
80 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
82 grep "^Result count: 10$" log || exit 1
85 echo " 3a: modifying the test record (xyz)..."
86 sed 's/UTAH/XYZ/g' <records/esdd0002.grs >records/esdd0002x.grs
87 mv records/esdd0002x.grs records/esdd0002.grs
89 echo " indexing it..."
90 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
93 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
95 grep "^Result count: 9$" log || exit 1
97 echo " 3b: modifying the test record back (utah)..."
98 sed 's/XYZ/UTAH/g' <records/esdd0002.grs >records/esdd0002x.grs
99 mv records/esdd0002x.grs records/esdd0002.grs
101 echo " indexing it..."
102 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
105 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
107 grep "^Result count: 10$" log || exit 1
110 echo "stopping server..."
111 test -f zebrasrv.pid || exit 1
112 kill -9 `cat zebrasrv.pid` || exit 1
114 rm -f records/esdd000[12].grs