From: Heikki Levanto Date: Mon, 20 Jul 2015 11:12:02 +0000 (+0200) Subject: New script, using curl. Does not work yet. X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=commitdiff_plain;h=3ed2e123f526bc10414854e52bebb22f3ff05079;p=pazpar2-moved-to-github.git New script, using curl. Does not work yet. Also, the old script is kind of broken, I just need to switch workplace... --- 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