Better cluster test
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 17 Dec 2013 14:05:57 +0000 (15:05 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 17 Dec 2013 14:05:57 +0000 (15:05 +0100)
Unfortunately needs YAZ 5.0.7. So, test_cluster.sh is not enabled by
default yet.

18 files changed:
test/pz.1.xml [deleted file]
test/pz.2.xml [deleted file]
test/pz.3.xml [deleted file]
test/pz.4.xml [deleted file]
test/run_pazpar2.sh
test/test_cluster.cfg [new file with mode: 0644]
test/test_cluster.pz.1.xml [new file with mode: 0644]
test/test_cluster.pz.2.xml [new file with mode: 0644]
test/test_cluster.pz.3.xml [new file with mode: 0644]
test/test_cluster.pz.4.xml [new file with mode: 0644]
test/test_cluster.urls
test/test_cluster_3.res
test/test_cluster_4.res [new file with mode: 0644]
test/test_cluster_5.res [new file with mode: 0644]
test/test_cluster_6.res [new file with mode: 0644]
test/test_cluster_7.res [new file with mode: 0644]
test/test_cluster_8.res [new file with mode: 0644]
test/test_cluster_9.res [new file with mode: 0644]

diff --git a/test/pz.1.xml b/test/pz.1.xml
deleted file mode 100644 (file)
index a59aaa0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<pz:cluster xmlns:pz="http://www.indexdata.com/pazpar2/1.0">
-<record xmlns="http://www.indexdata.com/pazpar2/1.0">
- <metadata type="author">Jack Collins</metadata>
- <metadata type="medium">book</metadata>
- <metadata type="date">1995</metadata>
- <metadata type="title">How to program a computer vol1</metadata>
-</record>
-<record xmlns="http://www.indexdata.com/pazpar2/1.0">
- <metadata type="author">Jack Collins</metadata>
- <metadata type="medium">book</metadata>
- <metadata type="date">1995</metadata>
- <metadata type="title">How to program a computer vol2</metadata>
-</record>
-</pz:cluster>
diff --git a/test/pz.2.xml b/test/pz.2.xml
deleted file mode 100644 (file)
index f899c96..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<pz:cluster xmlns:pz="http://www.indexdata.com/pazpar2/1.0">
-<record xmlns="http://www.indexdata.com/pazpar2/1.0">
- <metadata type="author">Jack Collins</metadata>
- <metadata type="medium">book</metadata>
- <metadata type="date">1995</metadata>
- <metadata type="title">How to program a computer vol3</metadata>
-</record>
-<record xmlns="http://www.indexdata.com/pazpar2/1.0">
- <metadata type="author">Jack Collins</metadata>
- <metadata type="medium">book</metadata>
- <metadata type="date">1995</metadata>
- <metadata type="title">How to program a computer vol2</metadata>
-</record>
-</pz:cluster>
diff --git a/test/pz.3.xml b/test/pz.3.xml
deleted file mode 100644 (file)
index ffdf34e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<record xmlns="http://www.indexdata.com/pazpar2/1.0">
- <metadata type="author">Jack Collins</metadata>
- <metadata type="medium">book</metadata>
- <metadata type="date">1995</metadata>
- <metadata type="title">How to program a computer vol1</metadata>
-</record>
diff --git a/test/pz.4.xml b/test/pz.4.xml
deleted file mode 100644 (file)
index f87b885..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<pz:cluster xmlns:pz="http://www.indexdata.com/pazpar2/1.0">
-<record xmlns="http://www.indexdata.com/pazpar2/1.0">
- <metadata type="author">Jack Collins</metadata>
- <metadata type="medium">book</metadata>
- <metadata type="date">1995</metadata>
- <metadata type="title">How to program a computer vol1</metadata>
-</record>
-<record xmlns="http://www.indexdata.com/pazpar2/1.0">
- <metadata type="author">Jack Collins</metadata>
- <metadata type="medium">book</metadata>
- <metadata type="date">1995</metadata>
- <metadata type="title">How to program a computer vol4</metadata>
-</record>
-</pz:cluster>
index de6c021..49ae5e8 100755 (executable)
@@ -9,9 +9,6 @@
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
-YAZ_ZTEST_XML_FETCH=${srcdir}/
-export YAZ_ZTEST_XML_FETCH
-
 # terminate pazpar2 if test takes more than this (in seconds)
 WAIT=120
 
@@ -87,6 +84,9 @@ if test "$icu" = "true"; then
 fi
 
 if test "$ztest" = "true" ; then
+    YAZ_ZTEST_XML_FETCH=${srcdir}/${PREFIX}.
+    export YAZ_ZTEST_XML_FETCH
+
     oIFS=$IFS
     IFS=:
     F=''
@@ -121,7 +121,7 @@ if test "$ztest" = "true" ; then
     fi
     rm -f ztest.pid
     rm -f ${PREFIX}_ztest.log
-    $F -l ${PREFIX}_ztest.log -p ztest.pid -D tcp:localhost:9999
+    $F -l ${PREFIX}_ztest.log -a ztest_apdu.log -p ztest.pid -D tcp:localhost:9999
     sleep 1
     if test ! -f ztest.pid; then
        echo "yaz-ztest could not be started"
diff --git a/test/test_cluster.cfg b/test/test_cluster.cfg
new file mode 100644 (file)
index 0000000..6b99b2f
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
+  <server>
+    <listen port="9763"/>
+    <service>
+      <icu_chain id="relevance" locale="en">
+       <transform rule="[:Control:] Any-Remove"/>
+       <tokenize rule="l"/>
+       <transform rule="[[:WhiteSpace:][:Punctuation:]`] Remove"/>
+       <casemap rule="l"/>
+      </icu_chain>
+
+      <icu_chain id="sort" locale="en">
+       <transform rule="[[:Control:][:WhiteSpace:][:Punctuation:]`] Remove"/>
+       <casemap rule="l"/>
+      </icu_chain>
+
+      <icu_chain id="mergekey" locale="en">
+       <tokenize rule="l"/>
+       <transform rule="[[:Control:][:WhiteSpace:][:Punctuation:]`] Remove"/>
+       <casemap rule="l"/>
+      </icu_chain>
+
+      <icu_chain id="facet" locale="en">
+       <display/>
+       <transform rule="Title"/>
+      </icu_chain>
+
+      <settings target="*">
+        <set target="localhost:9999" name="pz:name" value="ztest"/>
+        <set name="pz:cclmap:term" value="u=1016 t=l,r s=al"/>
+        <set name="pz:requestsyntax" value="xml"/>
+        <set name="pz:elements" value="pz"/>
+        <set name="pz:nativesyntax" value="xml"/>
+      </settings>
+      <metadata name="author" brief="yes" termlist="yes" merge="longest"
+                mergekey="optional" />
+      <metadata name="medium" brief="yes" merge="longest" mergekey="optional"/>
+      <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
+               termlist="yes"/>
+      <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6" mergekey="required" />
+    </service>
+  </server>
+</pazpar2>
+<!-- Keep this comment at the end of the file
+     Local variables:
+     mode: nxml
+     End:
+-->
diff --git a/test/test_cluster.pz.1.xml b/test/test_cluster.pz.1.xml
new file mode 100644 (file)
index 0000000..a59aaa0
--- /dev/null
@@ -0,0 +1,14 @@
+<pz:cluster xmlns:pz="http://www.indexdata.com/pazpar2/1.0">
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol1</metadata>
+</record>
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol2</metadata>
+</record>
+</pz:cluster>
diff --git a/test/test_cluster.pz.2.xml b/test/test_cluster.pz.2.xml
new file mode 100644 (file)
index 0000000..87c4eef
--- /dev/null
@@ -0,0 +1,14 @@
+<pz:cluster xmlns:pz="http://www.indexdata.com/pazpar2/1.0">
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol3</metadata>
+</record>
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol4</metadata>
+</record>
+</pz:cluster>
diff --git a/test/test_cluster.pz.3.xml b/test/test_cluster.pz.3.xml
new file mode 100644 (file)
index 0000000..ffdf34e
--- /dev/null
@@ -0,0 +1,6 @@
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol1</metadata>
+</record>
diff --git a/test/test_cluster.pz.4.xml b/test/test_cluster.pz.4.xml
new file mode 100644 (file)
index 0000000..f87b885
--- /dev/null
@@ -0,0 +1,14 @@
+<pz:cluster xmlns:pz="http://www.indexdata.com/pazpar2/1.0">
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol1</metadata>
+</record>
+<record xmlns="http://www.indexdata.com/pazpar2/1.0">
+ <metadata type="author">Jack Collins</metadata>
+ <metadata type="medium">book</metadata>
+ <metadata type="date">1995</metadata>
+ <metadata type="title">How to program a computer vol4</metadata>
+</record>
+</pz:cluster>
index 13fc5cf..6c772d5 100755 (executable)
@@ -1,3 +1,9 @@
 http://localhost:9763/search.pz2?command=init
+http://localhost:9763/search.pz2?session=1&command=search&query=1
+1 http://localhost:9763/search.pz2?session=1&command=show&block=1
+http://localhost:9763/search.pz2?session=1&command=search&query=2
+1 http://localhost:9763/search.pz2?session=1&command=show&block=1
+http://localhost:9763/search.pz2?session=1&command=search&query=3
+1 http://localhost:9763/search.pz2?session=1&command=show&block=1
 http://localhost:9763/search.pz2?session=1&command=search&query=4
 1 http://localhost:9763/search.pz2?session=1&command=show&block=1
index 80cf35c..2f88c6a 100644 (file)
@@ -2,44 +2,30 @@
 <show><status>OK</status>
 <activeclients>0</activeclients>
 <merged>1</merged>
-<total>23</total>
+<total>1</total>
 <start>0</start>
 <num>1</num>
 <hit>
  <md-author>Jack Collins</md-author>
  <md-medium>book</md-medium>
  <md-date>1995</md-date>
- <md-title>How to program a computer vol3</md-title>
+ <md-title>How to program a computer vol1</md-title>
  <location id="localhost:9999"
-    name="ztest" checksum="1482143625">
-  <md-author>Jack Collins</md-author>
-  <md-medium>book</md-medium>
-  <md-date>1995</md-date>
-  <md-title>How to program a computer vol3</md-title>
- </location>
- <location id="localhost:9999"
-    name="ztest" checksum="1482143625">
-  <md-author>Jack Collins</md-author>
-  <md-medium>book</md-medium>
-  <md-date>1995</md-date>
-  <md-title>How to program a computer vol2</md-title>
- </location>
- <location id="localhost:9999"
-    name="ztest" checksum="970776754">
+    name="ztest" checksum="1993510496">
   <md-author>Jack Collins</md-author>
   <md-medium>book</md-medium>
   <md-date>1995</md-date>
   <md-title>How to program a computer vol1</md-title>
  </location>
  <location id="localhost:9999"
-    name="ztest" checksum="459409883">
+    name="ztest" checksum="1993510496">
   <md-author>Jack Collins</md-author>
   <md-medium>book</md-medium>
   <md-date>1995</md-date>
-  <md-title>How to program a computer vol4</md-title>
+  <md-title>How to program a computer vol2</md-title>
  </location>
- <count>4</count>
- <relevance>89257</relevance>
- <recid>content: author jack collins medium book title how to program a computer vol</recid>
+ <count>2</count>
+ <relevance>0</relevance>
+ <recid>content: author jack collins medium book title how to program a computer vol1</recid>
 </hit>
 </show>
\ No newline at end of file
diff --git a/test/test_cluster_4.res b/test/test_cluster_4.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_cluster_5.res b/test/test_cluster_5.res
new file mode 100644 (file)
index 0000000..6da9672
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>2</merged>
+<total>2</total>
+<start>0</start>
+<num>2</num>
+<hit>
+ <md-author>Jack Collins</md-author>
+ <md-medium>book</md-medium>
+ <md-date>1995</md-date>
+ <md-title>How to program a computer vol1</md-title>
+ <location id="localhost:9999"
+    name="ztest" checksum="1993510496">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol1</md-title>
+ </location>
+ <location id="localhost:9999"
+    name="ztest" checksum="1993510496">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol2</md-title>
+ </location>
+ <count>2</count>
+ <relevance>0</relevance>
+ <recid>content: author jack collins medium book title how to program a computer vol1</recid>
+</hit>
+<hit>
+ <md-author>Jack Collins</md-author>
+ <md-medium>book</md-medium>
+ <md-date>1995</md-date>
+ <md-title>How to program a computer vol3</md-title>
+ <location id="localhost:9999"
+    name="ztest" checksum="1482143625">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol3</md-title>
+ </location>
+ <location id="localhost:9999"
+    name="ztest" checksum="1482143625">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol4</md-title>
+ </location>
+ <count>2</count>
+ <relevance>0</relevance>
+ <recid>content: author jack collins medium book title how to program a computer vol3</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_cluster_6.res b/test/test_cluster_6.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_cluster_7.res b/test/test_cluster_7.res
new file mode 100644 (file)
index 0000000..d616b21
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>2</merged>
+<total>3</total>
+<start>0</start>
+<num>2</num>
+<hit>
+ <md-author>Jack Collins</md-author>
+ <md-medium>book</md-medium>
+ <md-date>1995</md-date>
+ <md-title>How to program a computer vol1</md-title>
+ <location id="localhost:9999"
+    name="ztest" checksum="1993510496">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol1</md-title>
+ </location>
+ <location id="localhost:9999"
+    name="ztest" checksum="1993510496">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol2</md-title>
+ </location>
+ <count>2</count>
+ <relevance>0</relevance>
+ <recid>content: author jack collins medium book title how to program a computer vol1</recid>
+</hit>
+<hit>
+ <md-author>Jack Collins</md-author>
+ <md-medium>book</md-medium>
+ <md-date>1995</md-date>
+ <md-title>How to program a computer vol3</md-title>
+ <location id="localhost:9999"
+    name="ztest" checksum="1482143625">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol3</md-title>
+ </location>
+ <location id="localhost:9999"
+    name="ztest" checksum="1482143625">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol4</md-title>
+ </location>
+ <count>2</count>
+ <relevance>0</relevance>
+ <recid>content: author jack collins medium book title how to program a computer vol3</recid>
+</hit>
+</show>
\ No newline at end of file
diff --git a/test/test_cluster_8.res b/test/test_cluster_8.res
new file mode 100644 (file)
index 0000000..ab63fe6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search><status>OK</status></search>
\ No newline at end of file
diff --git a/test/test_cluster_9.res b/test/test_cluster_9.res
new file mode 100644 (file)
index 0000000..0b6bbcc
--- /dev/null
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<show><status>OK</status>
+<activeclients>0</activeclients>
+<merged>2</merged>
+<total>4</total>
+<start>0</start>
+<num>2</num>
+<hit>
+ <md-author>Jack Collins</md-author>
+ <md-medium>book</md-medium>
+ <md-date>1995</md-date>
+ <md-title>How to program a computer vol1</md-title>
+ <location id="localhost:9999"
+    name="ztest" checksum="1993510496">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol1</md-title>
+ </location>
+ <location id="localhost:9999"
+    name="ztest" checksum="1993510496">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol2</md-title>
+ </location>
+ <location id="localhost:9999"
+    name="ztest" checksum="459409883">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol4</md-title>
+ </location>
+ <count>3</count>
+ <relevance>0</relevance>
+ <recid>content: author jack collins medium book title how to program a computer vol1</recid>
+</hit>
+<hit>
+ <md-author>Jack Collins</md-author>
+ <md-medium>book</md-medium>
+ <md-date>1995</md-date>
+ <md-title>How to program a computer vol3</md-title>
+ <location id="localhost:9999"
+    name="ztest" checksum="1482143625">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol3</md-title>
+ </location>
+ <location id="localhost:9999"
+    name="ztest" checksum="1482143625">
+  <md-author>Jack Collins</md-author>
+  <md-medium>book</md-medium>
+  <md-date>1995</md-date>
+  <md-title>How to program a computer vol4</md-title>
+ </location>
+ <count>2</count>
+ <relevance>0</relevance>
+ <recid>content: author jack collins medium book title how to program a computer vol3</recid>
+</hit>
+</show>
\ No newline at end of file