From 3ed2e123f526bc10414854e52bebb22f3ff05079 Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Mon, 20 Jul 2015 13:12:02 +0200 Subject: [PATCH] New script, using curl. Does not work yet. Also, the old script is kind of broken, I just need to switch workplace... --- doc/common | 2 +- test/paz_1009-b.cfg | 14 +++++++++ test/paz_1009-b.sh | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ test/paz_1009.cfg | 2 +- test/paz_1009.sh | 2 +- test/paz_1009.urls | 9 +++--- 6 files changed, 108 insertions(+), 8 deletions(-) create mode 100644 test/paz_1009-b.cfg create mode 100755 test/paz_1009-b.sh diff --git a/doc/common b/doc/common index 6cdcfde..f6a5ec8 160000 --- a/doc/common +++ b/doc/common @@ -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 index 0000000..51921bc --- /dev/null +++ b/test/paz_1009-b.cfg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/test/paz_1009-b.sh b/test/paz_1009-b.sh new file mode 100755 index 0000000..0f6b048 --- /dev/null +++ b/test/paz_1009-b.sh @@ -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: diff --git a/test/paz_1009.cfg b/test/paz_1009.cfg index a4df1e2..70011a8 100644 --- a/test/paz_1009.cfg +++ b/test/paz_1009.cfg @@ -3,7 +3,7 @@ - + [[:WhiteSpace:][,.!;]]* } [$] > ; diff --git a/test/paz_1009.sh b/test/paz_1009.sh index ee63f14..904b03e 100755 --- a/test/paz_1009.sh +++ b/test/paz_1009.sh @@ -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 & diff --git a/test/paz_1009.urls b/test/paz_1009.urls index 1e094b3..f711ca0 100644 --- a/test/paz_1009.urls +++ b/test/paz_1009.urls @@ -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 -- 1.7.10.4