From 68a09c195d33239193f160dfabef54a6dbf0d239 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 27 Jun 2016 14:02:13 +0000 Subject: [PATCH] add timeouts to test --- src/scalarproduct/test_scalarproduct_negativezero.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scalarproduct/test_scalarproduct_negativezero.sh b/src/scalarproduct/test_scalarproduct_negativezero.sh index 0a6b9b65c..1ab7157af 100755 --- a/src/scalarproduct/test_scalarproduct_negativezero.sh +++ b/src/scalarproduct/test_scalarproduct_negativezero.sh @@ -22,13 +22,15 @@ PID=$! # sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe sleep 5 +which timeout &> /dev/null && DO_TIMEOUT="timeout 15" + # 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 & #GNUNET_LOG=';;;;DEBUG' -RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB` +RESULT=`${DO_TIMEOUT} gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB` # terminate the testbed kill $PID -- 2.25.1