Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / src / scalarproduct / test_scalarproduct_negativezero.sh
index 0a6b9b65c9981e7254a06ad280bbb261d883d790..1ab7157af89ce60e6e9816016be770f6c219a243 100755 (executable)
@@ -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