New script, using curl. Does not work yet.
authorHeikki Levanto <heikki@indexdata.dk>
Mon, 20 Jul 2015 11:12:02 +0000 (13:12 +0200)
committerHeikki Levanto <heikki@indexdata.dk>
Mon, 20 Jul 2015 11:12:02 +0000 (13:12 +0200)
Also, the old script is kind of broken, I just need to switch workplace...

doc/common
test/paz_1009-b.cfg [new file with mode: 0644]
test/paz_1009-b.sh [new file with mode: 0755]
test/paz_1009.cfg
test/paz_1009.sh
test/paz_1009.urls

index 6cdcfde..f6a5ec8 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 6cdcfde2c770531a571d755ed070059ee7ab4fc9
+Subproject commit f6a5ec8c243e2a6829a2917cb30c849612d6fd01
diff --git a/test/paz_1009-b.cfg b/test/paz_1009-b.cfg
new file mode 100644 (file)
index 0000000..51921bc
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pazpar2 xmlns="http://www.indexdata.com/pazpar2/1.0">
+  <!-- Used by paz_1009-b.sh -->
+  <threads number="0"/>
+  <server>
+    <listen port="9763"/>
+  </server>
+
+</pazpar2>
+<!-- Keep this comment at the end of the file
+     Local variables:
+     mode: nxml
+     End:
+-->
diff --git a/test/paz_1009-b.sh b/test/paz_1009-b.sh
new file mode 100755 (executable)
index 0000000..0f6b048
--- /dev/null
@@ -0,0 +1,87 @@
+#!/bin/sh
+# Test script for PAZ-1009 / AUT-258
+
+# Second script, this starts pazpar2 by itself, and uses curl
+# Also, posts a whole service
+
+# If $AGPORT is set, uses that as the AG gateway address
+# You can start one with something like
+#  ssh -L 9998:localhost:9998 somemachine
+#    .../aggw.pl @:9998
+# If not, starts one locally
+
+if [ -z $AGPORT ]
+then 
+    # Start the aggw
+    AGDIR=../../ag-integration/gateway
+    AGGW=$AGDIR/aggw.pl
+
+    if [ ! -x $AGGW ]
+    then
+        echo "AG Gateway $AGGW not found. Skipping test"
+        exit 0
+    fi
+
+    rm -f aggw.log aggw.pid apdu.log.* # -f to shut up if not there
+    LOG="-l aggw.log  -a apdu.log"  # uncomment to get the gw log in a file
+    AGPORT="@:9999"
+
+    $AGGW $LOG -p aggw.pid  $AGPORT &
+
+    sleep 1 # let the listener start up
+    if [ ! -f aggw.pid ]
+    then
+        echo "Could not start the AG gateway "
+        exit 1
+    fi
+    echo "Started the AG Gateway on $AGPORT. PID=" `cat aggw.pid`
+else
+    echo "Assuming AG gateway is running on $AGPORT"
+fi
+
+# Start pz2
+rm -f pazpar2.log
+../src/pazpar2 -v debug -d -X -l pazpar2.log -f paz_1009-b.cfg &
+PZ2PID=$!
+echo "Started pazpar2. PID=$PZ2PID"
+
+echo "Init"
+curl -X POST -H "Content-type: text/xml" --data-binary @paz_1009_service4.xml  \
+"localhost:9763?command=init"
+echo; echo
+
+echo "First Search"
+curl "localhost:9763?session=1&command=search&query=water"
+echo; echo
+
+echo "Bytarget"
+curl "localhost:9763?session=1&command=bytarget&block=1"
+echo; echo
+
+echo "Second Search"
+curl "localhost:9763?session=1&command=search&query=water&limit=publisher=U.S. G.P.O"
+echo; echo
+
+echo "Bytarget"
+curl "localhost:9763?session=1&command=bytarget&block=1"
+echo; echo
+
+
+# Kill PZ2
+kill $PZ2PID
+echo "Killed pz2 $PZ2PID"
+
+# Kill the aggw
+if [ -f aggw.pid ]
+then 
+    echo "Killing the aggw, pid " `cat aggw.pid`
+    kill `cat aggw.pid`
+    rm -f aggw.pid
+fi
+
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation: 2
+# sh-basic-offset: 4
+# End:
index a4df1e2..70011a8 100644 (file)
@@ -3,7 +3,7 @@
   <!-- Used by paz_1009.sh -->
   <server>
     <listen port="9763"/>
-    
+
     <icu_chain id="facet" locale="en">
       <transliterate>[[:WhiteSpace:][,.!;]]* } [$] > ;</transliterate>
       <display/>
index ee63f14..904b03e 100755 (executable)
@@ -21,7 +21,7 @@ then
 
     rm -f aggw.log aggw.pid apdu.log.* # -f to shut up if not there
     LOG="-l aggw.log  -a apdu.log"  # uncomment to get the gw log in a file
-    AGPORT="@:9998"
+    AGPORT="@:9999"
 
     $AGGW $LOG -p aggw.pid  $AGPORT &
 
index 1e094b3..f711ca0 100644 (file)
@@ -1,13 +1,12 @@
 http://localhost:9763/search.pz2?command=init&clear=1
-paz_1009_settings3.xml http://localhost:9763/search.pz2?session=1&command=settings
-
-
-http://localhost:9763/search.pz2?session=1&command=search&query=water&filter=pz:id%3D1986913
+paz_1009_settings3.xml http://localhost:9763/search.pz2?session=1&command=settings 
+http://localhost:9763/search.pz2?session=1&command=search&query=water&
 w http://localhost:9763/search.pz2?session=1&command=show&num=1&block=1
 http://localhost:9763/search.pz2?session=1&command=bytarget
 http://localhost:9763/search.pz2?session=1&command=termlist&num=50&name=xtargets%2Cseries%2Cpublisher
 
-http://localhost:9763/search.pz2?session=1&command=search&query=water&filter=pz:id%3D1986913&limit=publisher%3DU.S.%20G.P.O
+http://localhost:9763/search.pz2?session=1&command=search&query=water&limit=publisher%3DU.S.%20G.P.O
 w http://localhost:9763/search.pz2?session=1&command=show&num=1&block=1
 http://localhost:9763/search.pz2?session=1&command=bytarget
 http://localhost:9763/search.pz2?session=1&command=termlist&num=50&name=xtargets%2Cseries%2Cpublisher