A simple test with *one* sgml record
authorHeikki Levanto <heikki@indexdata.dk>
Mon, 11 Nov 2002 15:40:56 +0000 (15:40 +0000)
committerHeikki Levanto <heikki@indexdata.dk>
Mon, 11 Nov 2002 15:40:56 +0000 (15:40 +0000)
test/xpath/Makefile.am
test/xpath/simple1.rec [new file with mode: 0644]
test/xpath/simple1.sh [new file with mode: 0755]

index 8180e73..6a097cc 100644 (file)
@@ -1,4 +1,5 @@
-TESTS = test1.sh test2.sh test3.sh
+TESTS = test1.sh test2.sh test3.sh \
+        simple1.sh
 
 EXTRA_DIST = $(TESTS) zebra.cfg rec
 
diff --git a/test/xpath/simple1.rec b/test/xpath/simple1.rec
new file mode 100644 (file)
index 0000000..7a46f7d
--- /dev/null
@@ -0,0 +1,9 @@
+<sgml>
+  before
+  <tag>
+    inside
+  </tag>
+  after
+</sgml>
+
+
diff --git a/test/xpath/simple1.sh b/test/xpath/simple1.sh
new file mode 100755 (executable)
index 0000000..7fdd94f
--- /dev/null
@@ -0,0 +1,24 @@
+# simple1.sh - test with one simple sgml record
+
+LOG=simple1.log
+../../index/zebraidx -l $LOG init || exit 1
+../../index/zebraidx -l $LOG update simple1.rec || exit 1
+
+echo "Starting server " >> $LOG
+../../index/zebrasrv -l $LOG -S unix:socket &
+sleep 1
+test -f zebrasrv.pid || exit 2
+
+../testclient unix:socket -c 0 '@attr 1=/sgml/tag before' >> $LOG || exit 1
+../testclient unix:socket -c 1 '@attr 1=/sgml/tag inside' >> $LOG || exit 1
+../testclient unix:socket -c 0 '@attr 1=/sgml/tag after'  >> $LOG || exit 1
+
+../testclient unix:socket -c 0 '@attr 1=/sgml/none after'  >> $LOG || exit 1
+
+../testclient unix:socket -c 1 '@attr 1=/sgml before' >> $LOG || exit 1
+../testclient unix:socket -c 1 '@attr 1=/sgml inside' >> $LOG || exit 1
+../testclient unix:socket -c 1 '@attr 1=/sgml after'  >> $LOG || exit 1
+
+echo "killing server " >> $LOG
+kill `cat zebrasrv.pid` || exit 3
+echo ok >> $LOG