From bff536c1cf49964584834ff5f8149c0dbea35ac5 Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Fri, 17 Jul 2015 15:49:00 +0200 Subject: [PATCH] Option to use another aggw --- test/paz_1009.sh | 64 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 25 deletions(-) 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: -- 1.7.10.4