diff options
author | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-10-18 13:47:30 +0000 |
---|---|---|
committer | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-10-18 13:47:30 +0000 |
commit | 34365eb5c053d520dce3cc1f90921dc03e42fcdf (patch) | |
tree | a143cf6dd4ab46ce179346442dca21ff92ed01ce /src/scalarproduct/test_scalarproduct.sh | |
parent | 543d8cafc55fde62db363750d9a75536c73cbd79 (diff) | |
download | gnunet-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-x | src/scalarproduct/test_scalarproduct.sh | 45 |
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: | ||
4 | INPUTALICE="-k AAAA -e 10,10,10" | ||
5 | INPUTBOB="-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 |
5 | PREFIX=/tmp/test-scalarproduct`date +%H%M%S` | 8 | PREFIX=/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? |
8 | CFGALICE="-c $PREFIX/0/config" | 11 | CFGALICE="-c $PREFIX/0/config" |
9 | CFGBOB="-c $PREFIX/1/config" | 12 | CFGBOB="-c $PREFIX/1/config" |
10 | 13 | # log at which loglevel? | |
11 | #log at which loglevel? | 14 | LOGLEVEL=DEBUG |
12 | LOG="-L ERROR" | 15 | |
13 | 16 | echo start | |
14 | #launch two peers in line topology | 17 | # launch two peers in line topology non-interactively |
15 | GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler $LOG -c test_scalarproduct.conf -p 2 2>gnunet_error.log & | 18 | # |
16 | sleep 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) |
22 | GNUNET_LOG="scalarproduct;;;;$LOGLEVEL" GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 2>service.log & | ||
23 | sleep 2 | ||
24 | echo tesbed up | ||
25 | |||
26 | # get bob's peer ID, necessary for alice | ||
19 | PEERIDBOB=`gnunet-peerinfo -qs $CFGB` | 27 | PEERIDBOB=`gnunet-peerinfo -qs $CFGB` |
28 | echo peerinfo receivd | ||
20 | 29 | ||
21 | #payload for this test on both sides | 30 | GNUNET_LOG="scalarproduct;;;;$LOGLEVEL" gnunet-scalarproduct $CFGBOB $INPUTBOB 2>bob.log & |
22 | INPUTALICE="-k AAAA -e 10,10,10" | 31 | echo bob started |
23 | INPUTBOB="-k AAAA -e 10,10,10" | 32 | GNUNET_LOG="scalarproduct;;;;$LOGLEVEL" gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB 2>alice.log |
33 | echo alice returned | ||
24 | 34 | ||
25 | echo "gnunet-scalarproduct $LOG $CFGBOB $INPUTBOB &" | 35 | # termiante the testbed |
26 | echo "gnunet-scalarproduct $LOG $CFGALICE $INPUTALICE -p $PEERIDBOB -L ERROR" | 36 | kill $( pgrep -P $$ | tr '\n' ' ' ) |
27 | gnunet-scalarproduct $LOG $CFGBOB $INPUTBOB 2>bob_error.log & | 37 | echo killed testbed |
28 | RESULT=`gnunet-scalarproduct $LOG $CFGALICE $INPUTALICE -p $PEERIDBOB 2>alice_error.log` | ||
29 | 38 | ||
30 | EXPECTED="12C" | 39 | EXPECTED="12C" |
31 | if [ "$RESULT" == "$EXPECTED" ] | 40 | if [ "$RESULT" == "$EXPECTED" ] |