From fa0d8b6c561c504f38cce0a2648aef662a2f38c5 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 7 May 2002 11:04:37 +0000 Subject: [PATCH] Added test scripts --- test/gils/Makefile.am | 2 ++ test/gils/t1.sh | 3 +++ test/gils/t2.sh | 6 ++++++ test/gils/t3.sh | 12 ++++++++++++ test/gils/t4.sh | 2 ++ test/gils/t5.sh | 4 ++++ test/gils/t6.sh | 5 +++++ test/gils/t7.sh | 26 ++++++++++++++++++++++++++ test/gils/t8.sh | 2 ++ test/gils/zebra.cfg | 4 ++-- test/gils/zebra1.cfg | 14 ++++++++++++++ test/gils/zebra2.cfg | 18 ++++++++++++++++++ 12 files changed, 96 insertions(+), 2 deletions(-) create mode 100755 test/gils/t1.sh create mode 100755 test/gils/t2.sh create mode 100755 test/gils/t3.sh create mode 100755 test/gils/t4.sh create mode 100755 test/gils/t5.sh create mode 100755 test/gils/t6.sh create mode 100755 test/gils/t7.sh create mode 100755 test/gils/t8.sh create mode 100644 test/gils/zebra1.cfg create mode 100644 test/gils/zebra2.cfg diff --git a/test/gils/Makefile.am b/test/gils/Makefile.am index 5cc7812..167ff04 100644 --- a/test/gils/Makefile.am +++ b/test/gils/Makefile.am @@ -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 index 0000000..56f0746 --- /dev/null +++ b/test/gils/t1.sh @@ -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 index 0000000..07ae40b --- /dev/null +++ b/test/gils/t2.sh @@ -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 index 0000000..da14c99 --- /dev/null +++ b/test/gils/t3.sh @@ -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 index 0000000..331643c --- /dev/null +++ b/test/gils/t4.sh @@ -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 index 0000000..3801167 --- /dev/null +++ b/test/gils/t5.sh @@ -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 index 0000000..34a4028 --- /dev/null +++ b/test/gils/t6.sh @@ -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 index 0000000..7cf2c10 --- /dev/null +++ b/test/gils/t7.sh @@ -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/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 index 0000000..331643c --- /dev/null +++ b/test/gils/t8.sh @@ -0,0 +1,2 @@ +test -f zebrasrv.pid || exit 1 +kill `cat zebrasrv.pid` || exit 2 diff --git a/test/gils/zebra.cfg b/test/gils/zebra.cfg index 3241173..1acf688 100644 --- a/test/gils/zebra.cfg +++ b/test/gils/zebra.cfg @@ -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 index 0000000..1972192 --- /dev/null +++ b/test/gils/zebra1.cfg @@ -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 index 0000000..756dccc --- /dev/null +++ b/test/gils/zebra2.cfg @@ -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 -- 1.7.10.4