summaryrefslogtreecommitdiff
path: root/src/scalarproduct/test_scalarproduct_negative.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_negative.sh
parent36a80c833a5d5eb8f30460bb484cac01bdd9b65c (diff)
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_negative.sh')
-rwxr-xr-xsrc/scalarproduct/test_scalarproduct_negative.sh26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/scalarproduct/test_scalarproduct_negative.sh b/src/scalarproduct/test_scalarproduct_negative.sh
index 27fd345cc..1267a41ca 100755
--- a/src/scalarproduct/test_scalarproduct_negative.sh
+++ b/src/scalarproduct/test_scalarproduct_negative.sh
@@ -16,34 +16,26 @@ CFGBOB="-c $PREFIX/1/config"
# interactive mode would terminate the test immediately
# because the rest of the script is already in stdin,
# thus redirecting stdin does not suffice)
-GNUNET_LOG='scalarproduct;;;;DEBUG' GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 2>service.log &
+GNUNET_LOG=';;;;DEBUG' GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 &
PID=$!
+# sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe
sleep 5
# get bob's peer ID, necessary for alice
PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB`
-GNUNET_LOG='scalarproduct;;;;DEBUG' gnunet-scalarproduct $CFGBOB $INPUTBOB 2>bob.log &
-RESULT=`GNUNET_LOG='scalarproduct;;;;DEBUG' gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB 2>alice.log`
-
-cat alice.log bob.log service.log >> test_scalarproduct.log
-rm -f alice.log bob.log service.log
-ISSUES=$((`grep scalarproduct test_scalarproduct.log | grep -c ERROR` + `grep scalarproduct test_scalarproduct.log | grep -c WARNING`))
+GNUNET_LOG=';;;;DEBUG' gnunet-scalarproduct $CFGBOB $INPUTBOB &
+RESULT=`GNUNET_LOG=';;;;DEBUG' gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
# terminate the testbed
kill $PID
EXPECTED="-0CCC"
-if [ "$ISSUES" -eq "0" ]
+if [ "$RESULT" == "$EXPECTED" ]
then
- if [ "$RESULT" == "$EXPECTED" ]
- then
- echo "OK"
- rm -f test_scalarproduct.log
- exit 0
- fi
+ echo "OK"
+ exit 0
else
- echo "Result $RESULT NOTOK, see $PWD/test_scalarproduct.log for details"
- exit 1
+ echo "Result $RESULT NOTOK"
+ exit 1
fi
-