diff options
author | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-09-17 14:41:39 +0000 |
---|---|---|
committer | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-09-17 14:41:39 +0000 |
commit | f605b91f795d125009fd402dc92fdae987e3c012 (patch) | |
tree | 7a18399310f66d133d6e529a166ebc3dfa48af7d /src/scalarproduct/test_scalarproduct.sh | |
parent | 86bfb1ddbff2bd7b45d9927b24e50f5afb063feb (diff) | |
download | gnunet-f605b91f795d125009fd402dc92fdae987e3c012.tar.gz gnunet-f605b91f795d125009fd402dc92fdae987e3c012.zip |
removed old, deprecated SP tests
added new test which is only a bash script and computes the vectorproduct.
TODO: proper logging output, add a second test that kills one service instance
Diffstat (limited to 'src/scalarproduct/test_scalarproduct.sh')
-rwxr-xr-x | src/scalarproduct/test_scalarproduct.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/scalarproduct/test_scalarproduct.sh b/src/scalarproduct/test_scalarproduct.sh new file mode 100755 index 000000000..81bd9c2ec --- /dev/null +++ b/src/scalarproduct/test_scalarproduct.sh | |||
@@ -0,0 +1,31 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | CFGA="-c ./test_scalarproduct_alice.conf" | ||
4 | CFGB="-c ./test_scalarproduct_bob.conf" | ||
5 | #can't use ` directly | ||
6 | SESSIONDATA="-k AAAA -e 10,10,10" | ||
7 | EXPECTED="2C0" | ||
8 | |||
9 | gnunet-arm -s $CFGA | ||
10 | sleep 2 | ||
11 | gnunet-arm -s $CFGB | ||
12 | sleep 2 | ||
13 | |||
14 | IDB=`gnunet-peerinfo -s $CFGB | awk -F "\x60" '{print $2}' | awk -F "'" '{print $1}'` | ||
15 | |||
16 | gnunet-scalarproduct $CFGB $SESSIONDATA | ||
17 | |||
18 | RESULT=`gnunet-scalarproduct $CFGA $SESSIONDATA -p $IDB` | ||
19 | |||
20 | gnunet-arm -e $CFGA & | ||
21 | gnunet-arm -e $CFGB & | ||
22 | |||
23 | if [ "$RESULT" == "$EXPECTED" ] | ||
24 | then | ||
25 | echo "OK" | ||
26 | exit 0 | ||
27 | else | ||
28 | echo "Result $RESULT NOTOK" | ||
29 | exit 1 | ||
30 | fi | ||
31 | |||