summaryrefslogtreecommitdiff
path: root/src/scalarproduct/test_scalarproduct_negative.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-27 14:00:15 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-27 14:00:15 +0000
commitb0990df82b0e8ff831cbb01ed9fd1d6b4e592b8e (patch)
treecb99ed260752778cb0703edb141a732357b9dd25 /src/scalarproduct/test_scalarproduct_negative.sh
parent7ee0ec4b90a2096226f4dc23f9129fdda1c71488 (diff)
add timeouts to test
Diffstat (limited to 'src/scalarproduct/test_scalarproduct_negative.sh')
-rwxr-xr-xsrc/scalarproduct/test_scalarproduct_negative.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/scalarproduct/test_scalarproduct_negative.sh b/src/scalarproduct/test_scalarproduct_negative.sh
index eb9ead4bf..cbeb1b9fd 100755
--- a/src/scalarproduct/test_scalarproduct_negative.sh
+++ b/src/scalarproduct/test_scalarproduct_negative.sh
@@ -11,6 +11,8 @@ PREFIX=/tmp/test-scalarproduct`date +%H%M%S`
CFGALICE="-c $PREFIX/0/config"
CFGBOB="-c $PREFIX/1/config"
+which timeout &> /dev/null && DO_TIMEOUT="timeout 15"
+
# launch two peers in line topology non-interactively
#
# interactive mode would terminate the test immediately
@@ -23,12 +25,12 @@ PID=$!
sleep 5
# get bob's peer ID, necessary for alice
-PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB`
+PEERIDBOB=`${DO_TIMEOUT} gnunet-peerinfo -qs $CFGBOB`
#GNUNET_LOG=';;;;DEBUG'
-gnunet-scalarproduct $CFGBOB $INPUTBOB &
+${DO_TIMEOUT} gnunet-scalarproduct $CFGBOB $INPUTBOB &
#RESULT=`GNUNET_LOG=';;;;DEBUG'
-RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
+RESULT=`${DO_TIMEOUT} gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
# terminate the testbed
kill $PID