diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-07 00:42:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-07 00:42:31 +0000 |
commit | d30f73b49715899b2aa12e4819a0e105994c5411 (patch) | |
tree | a1c2ff23e637053477334bddcbe4e8969c6cfc5d /src/scalarproduct/test_scalarproduct.sh | |
parent | 7b993324a717497da6d34573a45150c48ca8786f (diff) | |
download | gnunet-d30f73b49715899b2aa12e4819a0e105994c5411.tar.gz gnunet-d30f73b49715899b2aa12e4819a0e105994c5411.zip |
-fix some of the obvious issues
Diffstat (limited to 'src/scalarproduct/test_scalarproduct.sh')
-rwxr-xr-x | src/scalarproduct/test_scalarproduct.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/scalarproduct/test_scalarproduct.sh b/src/scalarproduct/test_scalarproduct.sh index eed9de30f..8a34c2473 100755 --- a/src/scalarproduct/test_scalarproduct.sh +++ b/src/scalarproduct/test_scalarproduct.sh | |||
@@ -3,6 +3,7 @@ | |||
3 | # payload for this test: | 3 | # payload for this test: |
4 | INPUTALICE="-k CCC -e 'AB,10;RO,3;FL,3;LOL,-1;'" | 4 | INPUTALICE="-k CCC -e 'AB,10;RO,3;FL,3;LOL,-1;'" |
5 | INPUTBOB="-k CCC -e 'BC,-20000;RO,1000;FL,100;LOL,24;'" | 5 | INPUTBOB="-k CCC -e 'BC,-20000;RO,1000;FL,100;LOL,24;'" |
6 | EXPECTED="0CCC" | ||
6 | 7 | ||
7 | # necessary to make the testing prefix deterministic, so we can access the config files | 8 | # necessary to make the testing prefix deterministic, so we can access the config files |
8 | PREFIX=/tmp/test-scalarproduct`date +%H%M%S` | 9 | PREFIX=/tmp/test-scalarproduct`date +%H%M%S` |
@@ -16,30 +17,31 @@ CFGBOB="-c $PREFIX/1/config" | |||
16 | # interactive mode would terminate the test immediately | 17 | # interactive mode would terminate the test immediately |
17 | # because the rest of the script is already in stdin, | 18 | # because the rest of the script is already in stdin, |
18 | # thus redirecting stdin does not suffice) | 19 | # thus redirecting stdin does not suffice) |
19 | #GNUNET_LOG='scalarproduct;;;;DEBUG' | 20 | GNUNET_LOG='scalarproduct*;;;;DEBUG' |
20 | GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 & | 21 | GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 & |
21 | PID=$! | 22 | PID=$! |
22 | # sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe | 23 | # sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe |
24 | echo "Waiting for peers to start..." | ||
23 | sleep 5 | 25 | sleep 5 |
26 | echo "Running test..." | ||
24 | 27 | ||
25 | # get bob's peer ID, necessary for alice | 28 | # get bob's peer ID, necessary for alice |
26 | PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB` | 29 | PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB` |
27 | 30 | ||
28 | #GNUNET_LOG=';;;;DEBUG' | 31 | #GNUNET_LOG=';;;;DEBUG' |
29 | gnunet-scalarproduct $CFGBOB $INPUTBOB & | 32 | gnunet-scalarproduct $CFGBOB $INPUTBOB & |
30 | GNUNET_LOG=';;;;DEBUG' | 33 | #GNUNET_LOG=';;;;DEBUG' |
31 | RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB` | 34 | RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB` |
32 | 35 | ||
33 | # terminate the testbed | 36 | # terminate the testbed |
34 | kill $PID | 37 | kill $PID |
35 | 38 | ||
36 | EXPECTED="0CCC" | ||
37 | if [ "$RESULT" == "$EXPECTED" ] | 39 | if [ "$RESULT" == "$EXPECTED" ] |
38 | then | 40 | then |
39 | echo "OK" | 41 | echo "OK" |
40 | exit 0 | 42 | exit 0 |
41 | else | 43 | else |
42 | echo "Result $RESULT NOTOK" | 44 | echo "Result $RESULT, expected $EXPECTED - NOTOK" |
43 | exit 1 | 45 | exit 1 |
44 | fi | 46 | fi |
45 | 47 | ||