From: Heikki Levanto Date: Fri, 17 Jul 2015 13:49:00 +0000 (+0200) Subject: Option to use another aggw X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=bff536c1cf49964584834ff5f8149c0dbea35ac5;p=pazpar2-moved-to-github.git Option to use another aggw --- diff --git a/test/paz_1009.sh b/test/paz_1009.sh index dd96029..ee63f14 100755 --- a/test/paz_1009.sh +++ b/test/paz_1009.sh @@ -1,30 +1,41 @@ #!/bin/sh # Test script for PAZ-1009 / AUT-258 -# 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 +# 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="@:9998" + + $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 -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" - -$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` - TEST=`basename $0 .sh` # srcdir might be set by make srcdir=${srcdir:-"."} @@ -34,9 +45,12 @@ ${srcdir}/run_pazpar2.sh --icu $TEST # Kill the aggw -echo "Killing the aggw, pid " `cat aggw.pid` -kill `cat aggw.pid` -rm -f aggw.pid +if [ -f aggw.pid ] +then + echo "Killing the aggw, pid " `cat aggw.pid` + kill `cat aggw.pid` + rm -f aggw.pid +fi # Local Variables: