aboutsummaryrefslogtreecommitdiff
path: root/src/scalarproduct/test_scalarproduct_negativezero.sh
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2013-10-18 23:13:19 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2013-10-18 23:13:19 +0000
commitee34e30d52f46b6a90578bd48172536392d2d5bf (patch)
tree2050c6befda04274c666d5ca5072150ee7e9b570 /src/scalarproduct/test_scalarproduct_negativezero.sh
parent36a80c833a5d5eb8f30460bb484cac01bdd9b65c (diff)
downloadgnunet-ee34e30d52f46b6a90578bd48172536392d2d5bf.tar.gz
gnunet-ee34e30d52f46b6a90578bd48172536392d2d5bf.zip
removed final non functional dead leftover code from gaurav... may that code be forgotten
testcases now do better logging together with make check made testcases a bit more tolerat for really slow systems (5 seconds should suffice even on older systems) activated new checks in Makefile
Diffstat (limited to 'src/scalarproduct/test_scalarproduct_negativezero.sh')
-rwxr-xr-xsrc/scalarproduct/test_scalarproduct_negativezero.sh28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/scalarproduct/test_scalarproduct_negativezero.sh b/src/scalarproduct/test_scalarproduct_negativezero.sh
index 5035bdffd..196c46782 100755
--- a/src/scalarproduct/test_scalarproduct_negativezero.sh
+++ b/src/scalarproduct/test_scalarproduct_negativezero.sh
@@ -1,7 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2# compute a simple scalar product 2# compute a simple scalar product
3# payload for this test: 3# payload for this test:
4INPUTALICE="-k CCC -e -1,1,-1" 4INPUTALICE="-k CCC -e -1,1,1"
5INPUTBOB="-k CCC -e 1,1,0" 5INPUTBOB="-k CCC -e 1,1,0"
6 6
7# necessary to make the testing prefix deterministic, so we can access the config files 7# necessary to make the testing prefix deterministic, so we can access the config files
@@ -16,34 +16,26 @@ CFGBOB="-c $PREFIX/1/config"
16# interactive mode would terminate the test immediately 16# interactive mode would terminate the test immediately
17# because the rest of the script is already in stdin, 17# because the rest of the script is already in stdin,
18# thus redirecting stdin does not suffice) 18# thus redirecting stdin does not suffice)
19GNUNET_LOG='scalarproduct;;;;DEBUG' GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 2>service.log & 19GNUNET_LOG=';;;;DEBUG' GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 &
20PID=$! 20PID=$!
21# sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe
21sleep 5 22sleep 5
22 23
23# get bob's peer ID, necessary for alice 24# get bob's peer ID, necessary for alice
24PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB` 25PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB`
25 26
26GNUNET_LOG='scalarproduct;;;;DEBUG' gnunet-scalarproduct $CFGBOB $INPUTBOB 2>bob.log & 27GNUNET_LOG=';;;;DEBUG' gnunet-scalarproduct $CFGBOB $INPUTBOB &
27RESULT=`GNUNET_LOG='scalarproduct;;;;DEBUG' gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB 2>alice.log` 28RESULT=`GNUNET_LOG=';;;;DEBUG' gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
28
29cat alice.log bob.log service.log >> test_scalarproduct.log
30rm -f alice.log bob.log service.log
31ISSUES=$((`grep scalarproduct test_scalarproduct.log | grep -c ERROR` + `grep scalarproduct test_scalarproduct.log | grep -c WARNING`))
32 29
33# terminate the testbed 30# terminate the testbed
34kill $PID 31kill $PID
35 32
36EXPECTED="00" 33EXPECTED="00"
37if [ "$ISSUES" -eq "0" ] 34if [ "$RESULT" == "$EXPECTED" ]
38then 35then
39 if [ "$RESULT" == "$EXPECTED" ] 36 echo "OK"
40 then 37 exit 0
41 echo "OK"
42 rm -f test_scalarproduct.log
43 exit 0
44 fi
45else 38else
46 echo "Result $RESULT NOTOK, see $PWD/test_scalarproduct.log for details" 39 echo "Result $RESULT NOTOK"
47 exit 1 40 exit 1
48fi 41fi
49