aboutsummaryrefslogtreecommitdiff
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
parent7ee0ec4b90a2096226f4dc23f9129fdda1c71488 (diff)
downloadgnunet-b0990df82b0e8ff831cbb01ed9fd1d6b4e592b8e.tar.gz
gnunet-b0990df82b0e8ff831cbb01ed9fd1d6b4e592b8e.zip
add timeouts to test
-rwxr-xr-xsrc/scalarproduct/test_scalarproduct.sh9
-rwxr-xr-xsrc/scalarproduct/test_scalarproduct_negative.sh8
2 files changed, 10 insertions, 7 deletions
diff --git a/src/scalarproduct/test_scalarproduct.sh b/src/scalarproduct/test_scalarproduct.sh
index dd9bb80a5..c0401beb7 100755
--- a/src/scalarproduct/test_scalarproduct.sh
+++ b/src/scalarproduct/test_scalarproduct.sh
@@ -25,13 +25,15 @@ echo "Waiting for peers to start..."
25sleep 5 25sleep 5
26echo "Running test..." 26echo "Running test..."
27 27
28which timeout &> /dev/null && DO_TIMEOUT="timeout 15"
29
28# get bob's peer ID, necessary for alice 30# get bob's peer ID, necessary for alice
29PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB` 31PEERIDBOB=`${DO_TIMEOUT} gnunet-peerinfo -qs $CFGBOB`
30 32
31#GNUNET_LOG=';;;;DEBUG' 33#GNUNET_LOG=';;;;DEBUG'
32gnunet-scalarproduct $CFGBOB $INPUTBOB & 34${DO_TIMEOUT} gnunet-scalarproduct $CFGBOB $INPUTBOB &
33#GNUNET_LOG=';;;;DEBUG' 35#GNUNET_LOG=';;;;DEBUG'
34RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB` 36RESULT=`${DO_TIMEOUT} gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
35 37
36# terminate the testbed 38# terminate the testbed
37kill $PID 39kill $PID
@@ -44,4 +46,3 @@ else
44 echo "Result $RESULT, expected $EXPECTED - NOTOK" 46 echo "Result $RESULT, expected $EXPECTED - NOTOK"
45 exit 1 47 exit 1
46fi 48fi
47
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`
11CFGALICE="-c $PREFIX/0/config" 11CFGALICE="-c $PREFIX/0/config"
12CFGBOB="-c $PREFIX/1/config" 12CFGBOB="-c $PREFIX/1/config"
13 13
14which timeout &> /dev/null && DO_TIMEOUT="timeout 15"
15
14# launch two peers in line topology non-interactively 16# launch two peers in line topology non-interactively
15# 17#
16# interactive mode would terminate the test immediately 18# interactive mode would terminate the test immediately
@@ -23,12 +25,12 @@ PID=$!
23sleep 5 25sleep 5
24 26
25# get bob's peer ID, necessary for alice 27# get bob's peer ID, necessary for alice
26PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB` 28PEERIDBOB=`${DO_TIMEOUT} gnunet-peerinfo -qs $CFGBOB`
27 29
28#GNUNET_LOG=';;;;DEBUG' 30#GNUNET_LOG=';;;;DEBUG'
29gnunet-scalarproduct $CFGBOB $INPUTBOB & 31${DO_TIMEOUT} gnunet-scalarproduct $CFGBOB $INPUTBOB &
30#RESULT=`GNUNET_LOG=';;;;DEBUG' 32#RESULT=`GNUNET_LOG=';;;;DEBUG'
31RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB` 33RESULT=`${DO_TIMEOUT} gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
32 34
33# terminate the testbed 35# terminate the testbed
34kill $PID 36kill $PID