diff options
author | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-10-16 20:29:10 +0000 |
---|---|---|
committer | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-10-16 20:29:10 +0000 |
commit | eec0e5088ec9437f5c0cf9d3ffef87603ad2777a (patch) | |
tree | 539ee940e481ba9d5174c44c227680c6bf048efb /src/scalarproduct/test_scalarproduct.sh | |
parent | 608eb4de09b1033c24ee5b6ad095399e375ac511 (diff) | |
download | gnunet-eec0e5088ec9437f5c0cf9d3ffef87603ad2777a.tar.gz gnunet-eec0e5088ec9437f5c0cf9d3ffef87603ad2777a.zip |
complete testcase template, currently functionally blocked by two issues in the testbed profiler
renamed a couple of cariables
Diffstat (limited to 'src/scalarproduct/test_scalarproduct.sh')
-rwxr-xr-x | src/scalarproduct/test_scalarproduct.sh | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/scalarproduct/test_scalarproduct.sh b/src/scalarproduct/test_scalarproduct.sh index 0ac0d82fc..29f78ef9b 100755 --- a/src/scalarproduct/test_scalarproduct.sh +++ b/src/scalarproduct/test_scalarproduct.sh | |||
@@ -1,21 +1,33 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | # compute a simple scalar product | ||
2 | 3 | ||
3 | #necessary to make the testing prefix deterministic, so we can access the config files | 4 | #necessary to make the testing prefix deterministic, so we can access the config files |
4 | GNUNET_TESTING_PREFIX=/tmp/test-scalarproduct`date +%H%M%S` | 5 | PREFIX=/tmp/test-scalarproduct`date +%H%M%S` |
5 | CFGALICE="-c $GNUNET_TESTING_PREFIX/0/config" | ||
6 | CFGBOB="-c $GNUNET_TESTING_PREFIX/1/config" | ||
7 | 6 | ||
8 | ../testbed/gnunet-testbed-profiler -c test_scalarproduct.conf -p 2 2>gnunet_error.log & | 7 | #where can we find the peers config files? |
8 | CFGALICE="-c $PREFIX/0/config" | ||
9 | CFGBOB="-c $PREFIX/1/config" | ||
10 | |||
11 | #log at which loglevel? | ||
12 | LOG="-L ERROR" | ||
13 | |||
14 | #launch two peers in line topology | ||
15 | GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler $LOG -c test_scalarproduct.conf -p 2 2>gnunet_error.log & | ||
9 | sleep 5 | 16 | sleep 5 |
10 | 17 | ||
18 | #get bob's peer ID, necessary for alice | ||
11 | PEERIDBOB=`gnunet-peerinfo -qs $CFGB` | 19 | PEERIDBOB=`gnunet-peerinfo -qs $CFGB` |
20 | |||
21 | #payload for this test on both sides | ||
12 | INPUTALICE="-k AAAA -e 10,10,10" | 22 | INPUTALICE="-k AAAA -e 10,10,10" |
13 | INPUTBOB="-k AAAA -e 10,10,10" | 23 | INPUTBOB="-k AAAA -e 10,10,10" |
14 | EXPECTED="2C0" | ||
15 | 24 | ||
16 | gnunet-scalarproduct $CFGBOB $INPUTBOB | 25 | echo "gnunet-scalarproduct $LOG $CFGBOB $INPUTBOB &" |
17 | RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB 2>client_error.log` | 26 | echo "gnunet-scalarproduct $LOG $CFGALICE $INPUTALICE -p $PEERIDBOB -L ERROR" |
27 | gnunet-scalarproduct $LOG $CFGBOB $INPUTBOB 2>bob_error.log & | ||
28 | RESULT=`gnunet-scalarproduct $LOG $CFGALICE $INPUTALICE -p $PEERIDBOB 2>alice_error.log` | ||
18 | 29 | ||
30 | EXPECTED="12C" | ||
19 | if [ "$RESULT" == "$EXPECTED" ] | 31 | if [ "$RESULT" == "$EXPECTED" ] |
20 | then | 32 | then |
21 | echo "OK" | 33 | echo "OK" |