gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r37393 - gnunet/src/scalarproduct


From: gnunet
Subject: [GNUnet-SVN] r37393 - gnunet/src/scalarproduct
Date: Mon, 27 Jun 2016 16:00:16 +0200

Author: grothoff
Date: 2016-06-27 16:00:15 +0200 (Mon, 27 Jun 2016)
New Revision: 37393

Modified:
   gnunet/src/scalarproduct/test_scalarproduct.sh
   gnunet/src/scalarproduct/test_scalarproduct_negative.sh
Log:
add timeouts to test

Modified: gnunet/src/scalarproduct/test_scalarproduct.sh
===================================================================
--- gnunet/src/scalarproduct/test_scalarproduct.sh      2016-06-27 13:52:31 UTC 
(rev 37392)
+++ gnunet/src/scalarproduct/test_scalarproduct.sh      2016-06-27 14:00:15 UTC 
(rev 37393)
@@ -25,13 +25,15 @@
 sleep 5
 echo "Running test..."
 
+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
@@ -44,4 +46,3 @@
        echo "Result $RESULT, expected $EXPECTED - NOTOK"
        exit 1
 fi
-

Modified: gnunet/src/scalarproduct/test_scalarproduct_negative.sh
===================================================================
--- gnunet/src/scalarproduct/test_scalarproduct_negative.sh     2016-06-27 
13:52:31 UTC (rev 37392)
+++ gnunet/src/scalarproduct/test_scalarproduct_negative.sh     2016-06-27 
14:00:15 UTC (rev 37393)
@@ -11,6 +11,8 @@
 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 @@
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]