aboutsummaryrefslogtreecommitdiff
path: root/src/scalarproduct/test_scalarproduct.sh
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2013-10-18 13:47:30 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2013-10-18 13:47:30 +0000
commit34365eb5c053d520dce3cc1f90921dc03e42fcdf (patch)
treea143cf6dd4ab46ce179346442dca21ff92ed01ce /src/scalarproduct/test_scalarproduct.sh
parent543d8cafc55fde62db363750d9a75536c73cbd79 (diff)
downloadgnunet-34365eb5c053d520dce3cc1f90921dc03e42fcdf.tar.gz
gnunet-34365eb5c053d520dce3cc1f90921dc03e42fcdf.zip
finished SP-testcase
SP now properly resets a couple of freed values fixed a double-free fixed a logics bug in handle_service_response
Diffstat (limited to 'src/scalarproduct/test_scalarproduct.sh')
-rwxr-xr-xsrc/scalarproduct/test_scalarproduct.sh45
1 files changed, 27 insertions, 18 deletions
diff --git a/src/scalarproduct/test_scalarproduct.sh b/src/scalarproduct/test_scalarproduct.sh
index 29f78ef9b..eaffd925d 100755
--- a/src/scalarproduct/test_scalarproduct.sh
+++ b/src/scalarproduct/test_scalarproduct.sh
@@ -1,31 +1,40 @@
1#!/bin/bash 1#!/bin/bash
2# compute a simple scalar product 2# compute a simple scalar product
3# payload for this test:
4INPUTALICE="-k AAAA -e 10,10,10"
5INPUTBOB="-k AAAA -e 10,10,10"
3 6
4#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
5PREFIX=/tmp/test-scalarproduct`date +%H%M%S` 8PREFIX=/tmp/test-scalarproduct`date +%H%M%S`
6 9
7#where can we find the peers config files? 10# where can we find the peers config files?
8CFGALICE="-c $PREFIX/0/config" 11CFGALICE="-c $PREFIX/0/config"
9CFGBOB="-c $PREFIX/1/config" 12CFGBOB="-c $PREFIX/1/config"
10 13# log at which loglevel?
11#log at which loglevel? 14LOGLEVEL=DEBUG
12LOG="-L ERROR" 15
13 16echo start
14#launch two peers in line topology 17# launch two peers in line topology non-interactively
15GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler $LOG -c test_scalarproduct.conf -p 2 2>gnunet_error.log & 18#
16sleep 5 19# interactive mode would terminate the test immediately
17 20# because the rest of the script is already in stdin,
18#get bob's peer ID, necessary for alice 21# thus redirecting stdin does not suffice)
22GNUNET_LOG="scalarproduct;;;;$LOGLEVEL" GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 2>service.log &
23sleep 2
24echo tesbed up
25
26# get bob's peer ID, necessary for alice
19PEERIDBOB=`gnunet-peerinfo -qs $CFGB` 27PEERIDBOB=`gnunet-peerinfo -qs $CFGB`
28echo peerinfo receivd
20 29
21#payload for this test on both sides 30GNUNET_LOG="scalarproduct;;;;$LOGLEVEL" gnunet-scalarproduct $CFGBOB $INPUTBOB 2>bob.log &
22INPUTALICE="-k AAAA -e 10,10,10" 31echo bob started
23INPUTBOB="-k AAAA -e 10,10,10" 32GNUNET_LOG="scalarproduct;;;;$LOGLEVEL" gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB 2>alice.log
33echo alice returned
24 34
25echo "gnunet-scalarproduct $LOG $CFGBOB $INPUTBOB &" 35# termiante the testbed
26echo "gnunet-scalarproduct $LOG $CFGALICE $INPUTALICE -p $PEERIDBOB -L ERROR" 36kill $( pgrep -P $$ | tr '\n' ' ' )
27gnunet-scalarproduct $LOG $CFGBOB $INPUTBOB 2>bob_error.log & 37echo killed testbed
28RESULT=`gnunet-scalarproduct $LOG $CFGALICE $INPUTALICE -p $PEERIDBOB 2>alice_error.log`
29 38
30EXPECTED="12C" 39EXPECTED="12C"
31if [ "$RESULT" == "$EXPECTED" ] 40if [ "$RESULT" == "$EXPECTED" ]