Added test scripts
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 7 May 2002 11:04:37 +0000 (11:04 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 7 May 2002 11:04:37 +0000 (11:04 +0000)
12 files changed:
test/gils/Makefile.am
test/gils/t1.sh [new file with mode: 0755]
test/gils/t2.sh [new file with mode: 0755]
test/gils/t3.sh [new file with mode: 0755]
test/gils/t4.sh [new file with mode: 0755]
test/gils/t5.sh [new file with mode: 0755]
test/gils/t6.sh [new file with mode: 0755]
test/gils/t7.sh [new file with mode: 0755]
test/gils/t8.sh [new file with mode: 0755]
test/gils/zebra.cfg
test/gils/zebra1.cfg [new file with mode: 0644]
test/gils/zebra2.cfg [new file with mode: 0644]

index 5cc7812..167ff04 100644 (file)
@@ -8,3 +8,5 @@ dist-hook:
 test:
        ../../index/zmbolidx init
        ../../index/zmbolidx update records
+
+TESTS = t1.sh t2.sh t3.sh t4.sh t5.sh t6.sh t7.sh t8.sh
diff --git a/test/gils/t1.sh b/test/gils/t1.sh
new file mode 100755 (executable)
index 0000000..56f0746
--- /dev/null
@@ -0,0 +1,3 @@
+../../index/zebraidx -l idx.log init || exit 1
+rm -f records/esdd000[12].grs
+../../index/zebraidx -l idx.log -c zebra1.cfg update records  || exit 2
diff --git a/test/gils/t2.sh b/test/gils/t2.sh
new file mode 100755 (executable)
index 0000000..07ae40b
--- /dev/null
@@ -0,0 +1,6 @@
+test -f zebrasrv.pid && kill -9 `cat zebrasrv.pid`
+rm -f zebrasrv.pid
+rm -f srv.log
+../../index/zebrasrv -S -c zebra1.cfg -l srv.log tcp:@:9901 &
+sleep 1
+test -f zebrasrv.pid || exit 1
diff --git a/test/gils/t3.sh b/test/gils/t3.sh
new file mode 100755 (executable)
index 0000000..da14c99
--- /dev/null
@@ -0,0 +1,12 @@
+test -f zebrasrv.pid || exit 1
+../../../yaz/zoom/zoomtst1 localhost:9901 utah > log || exit 3
+grep "^Result count: 17$" log || exit 4
+../../../yaz/zoom/zoomtst1 localhost:9901 "@or utah the" > log || exit 5
+grep "^Result count: 40$" log || exit 6
+../../../yaz/zoom/zoomtst1 localhost:9901 "@attr 1=4 the" > log || exit 7
+grep "^Result count: 1$" log || exit 8
+../../../yaz/zoom/zoomtst1 localhost:9901 "@attr 1=4 utah" > log || exit 9
+grep "^Result count: 9$" log || exit 10
+../../index/zebraidx -l idx.log -c  zebra1.cfg update records || exit 11
+../../../yaz/zoom/zoomtst1 localhost:9901 "@attr 1=4 utah" > log || exit 12
+grep "^Result count: 18$" log || exit 14
diff --git a/test/gils/t4.sh b/test/gils/t4.sh
new file mode 100755 (executable)
index 0000000..331643c
--- /dev/null
@@ -0,0 +1,2 @@
+test -f zebrasrv.pid || exit 1
+kill `cat zebrasrv.pid` || exit 2
diff --git a/test/gils/t5.sh b/test/gils/t5.sh
new file mode 100755 (executable)
index 0000000..3801167
--- /dev/null
@@ -0,0 +1,4 @@
+rm -f idx.log
+../../index/zebraidx -l idx.log init || exit 1
+../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 2
+../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 2
diff --git a/test/gils/t6.sh b/test/gils/t6.sh
new file mode 100755 (executable)
index 0000000..34a4028
--- /dev/null
@@ -0,0 +1,5 @@
+rm -f zebrasrv.pid
+rm -f srv.log
+../../index/zebrasrv -S -c zebra2.cfg -l srv.log tcp:@:9901 &
+sleep 1
+test -f zebrasrv.pid || exit 1
diff --git a/test/gils/t7.sh b/test/gils/t7.sh
new file mode 100755 (executable)
index 0000000..7cf2c10
--- /dev/null
@@ -0,0 +1,26 @@
+test -f zebrasrv.pid || exit 1
+../../../yaz/zoom/zoomtst1 localhost:9901 "@attr 1=4 utah" > log || exit 2
+grep "^Result count: 9$" log || exit 1
+../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 2
+../../../yaz/zoom/zoomtst1 localhost:9901 "@attr 1=4 utah" > log || exit 2
+grep "^Result count: 9$" log || exit 1
+cp records/esdd0006.grs records/esdd0001.grs
+../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 2
+../../../yaz/zoom/zoomtst1 localhost:9901 "@attr 1=4 utah" > log || exit 2
+grep "^Result count: 10$" log || exit 1
+touch records/esdd0001.grs
+../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 2
+../../../yaz/zoom/zoomtst1 localhost:9901 "@attr 1=4 utah" > log || exit 2
+grep "^Result count: 10$" log || exit 1
+mv records/esdd0001.grs records/esdd0002.grs
+../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 2
+../../../yaz/zoom/zoomtst1 localhost:9901 "@attr 1=4 utah" > log || exit 2
+grep "^Result count: 10$" log || exit 1
+sleep 1
+sed 's/UTAH/XYZ/g' <records/esdd0002.grs >records/esdd0002x.grs
+mv records/esdd0002x.grs records/esdd0002.grs
+../../index/zebraidx -l idx.log -c zebra2.cfg update records || exit 2
+../../../yaz/zoom/zoomtst1 localhost:9901 "@attr 1=4 utah" > log || exit 2
+grep "^Result count: 9$" log || exit 1
+../../../yaz/zoom/zoomtst1 localhost:9901 "@attr 1=4 xyz" > log || exit 2
+grep "^Result count: 1$" log || exit 1
diff --git a/test/gils/t8.sh b/test/gils/t8.sh
new file mode 100755 (executable)
index 0000000..331643c
--- /dev/null
@@ -0,0 +1,2 @@
+test -f zebrasrv.pid || exit 1
+kill `cat zebrasrv.pid` || exit 2
index 3241173..1acf688 100644 (file)
@@ -1,5 +1,5 @@
 # Simple Zebra configuration file
-# $Id: zebra.cfg,v 1.15 2002-04-30 08:28:37 adam Exp $
+# $Id: zebra.cfg,v 1.16 2002-05-07 11:04:37 adam Exp $
 #
 # Where the schema files, attribute files, etc are located.
 profilePath: .:../../tab:../../../yaz/tab
@@ -14,4 +14,4 @@ recordtype: grs.sgml
 #storekeys: 1
 #storedata: 1
 #recordId: (bib1,identifier-standard)
-isam: c
+isam: b
diff --git a/test/gils/zebra1.cfg b/test/gils/zebra1.cfg
new file mode 100644 (file)
index 0000000..1972192
--- /dev/null
@@ -0,0 +1,14 @@
+# Simple Zebra configuration file
+# $Id: zebra1.cfg,v 1.1 2002-05-07 11:04:37 adam Exp $
+#
+# Where the schema files, attribute files, etc are located.
+profilePath: .:../../tab:../../../yaz/tab
+
+# Files that describe the attribute sets supported.
+attset: bib1.att
+attset: gils.att
+attset: explain.att
+
+recordtype: grs.sgml
+
+isam: c
diff --git a/test/gils/zebra2.cfg b/test/gils/zebra2.cfg
new file mode 100644 (file)
index 0000000..756dccc
--- /dev/null
@@ -0,0 +1,18 @@
+# Simple Zebra configuration file
+# $Id: zebra2.cfg,v 1.1 2002-05-07 11:04:37 adam Exp $
+#
+# Where the schema files, attribute files, etc are located.
+profilePath: .:../../tab:../../../yaz/tab
+
+# Files that describe the attribute sets supported.
+attset: bib1.att
+attset: gils.att
+attset: explain.att
+
+recordtype: grs.sgml
+
+storeData: 1
+storeKeys: 1
+recordId: file
+
+isam: c