1 echo "Testing with storekeys (zebra2.cfg)"
4 rm -f records/esdd000[12].grs # these should not be here, will be created later
5 ../../index/zebraidx -l idx.log -c zebra2.cfg init || exit 1
8 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
11 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
13 echo "killing old server (if any)..."
14 test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid`
18 echo "starting server..."
19 ../../index/zebrasrv -S -c zebra2.cfg -l srv.log tcp:@:9901 &
21 test -f zebrasrv.pid || exit 1
24 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
25 grep "^Result count: 9$" log || exit 1
28 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
31 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
32 grep "^Result count: 9$" log || exit 1
34 echo "making test records..."
35 cp records/esdd0006.grs records/esdd0001.grs
37 echo "indexing them..."
38 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
41 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
42 grep "^Result count: 10$" log || exit 1
43 touch records/esdd0001.grs
45 echo "indexing again..."
46 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
49 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
50 grep "^Result count: 10$" log || exit 1
52 echo "making another test record..."
53 mv records/esdd0001.grs records/esdd0002.grs
55 echo "indexing it too..."
56 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
59 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
60 grep "^Result count: 10$" log || exit 1
63 echo "modifying a test record..."
64 sed 's/UTAH/XYZ/g' <records/esdd0002.grs >records/esdd0002x.grs
65 mv records/esdd0002x.grs records/esdd0002.grs
68 ../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 1
72 ../testclient localhost:9901 "@attr 1=4 utah" > log || exit 1
73 grep "^Result count: 9$" log || exit 1
76 ../testclient localhost:9901 "@attr 1=4 xyz" > log || exit 1
77 grep "^Result count: 1$" log || exit 1
79 echo "stopping server..."
80 test -f zebrasrv.pid || exit 1
81 kill `cat zebrasrv.pid` || exit 1
83 rm -f records/esdd000[12].grs