aboutsummaryrefslogtreecommitdiff
path: root/src/scalarproduct/test_scalarproduct.sh
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2013-10-16 20:29:10 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2013-10-16 20:29:10 +0000
commiteec0e5088ec9437f5c0cf9d3ffef87603ad2777a (patch)
tree539ee940e481ba9d5174c44c227680c6bf048efb /src/scalarproduct/test_scalarproduct.sh
parent608eb4de09b1033c24ee5b6ad095399e375ac511 (diff)
downloadgnunet-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-xsrc/scalarproduct/test_scalarproduct.sh26
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
4GNUNET_TESTING_PREFIX=/tmp/test-scalarproduct`date +%H%M%S` 5PREFIX=/tmp/test-scalarproduct`date +%H%M%S`
5CFGALICE="-c $GNUNET_TESTING_PREFIX/0/config"
6CFGBOB="-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?
8CFGALICE="-c $PREFIX/0/config"
9CFGBOB="-c $PREFIX/1/config"
10
11#log at which loglevel?
12LOG="-L ERROR"
13
14#launch two peers in line topology
15GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler $LOG -c test_scalarproduct.conf -p 2 2>gnunet_error.log &
9sleep 5 16sleep 5
10 17
18#get bob's peer ID, necessary for alice
11PEERIDBOB=`gnunet-peerinfo -qs $CFGB` 19PEERIDBOB=`gnunet-peerinfo -qs $CFGB`
20
21#payload for this test on both sides
12INPUTALICE="-k AAAA -e 10,10,10" 22INPUTALICE="-k AAAA -e 10,10,10"
13INPUTBOB="-k AAAA -e 10,10,10" 23INPUTBOB="-k AAAA -e 10,10,10"
14EXPECTED="2C0"
15 24
16gnunet-scalarproduct $CFGBOB $INPUTBOB 25echo "gnunet-scalarproduct $LOG $CFGBOB $INPUTBOB &"
17RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB 2>client_error.log` 26echo "gnunet-scalarproduct $LOG $CFGALICE $INPUTALICE -p $PEERIDBOB -L ERROR"
27gnunet-scalarproduct $LOG $CFGBOB $INPUTBOB 2>bob_error.log &
28RESULT=`gnunet-scalarproduct $LOG $CFGALICE $INPUTALICE -p $PEERIDBOB 2>alice_error.log`
18 29
30EXPECTED="12C"
19if [ "$RESULT" == "$EXPECTED" ] 31if [ "$RESULT" == "$EXPECTED" ]
20then 32then
21 echo "OK" 33 echo "OK"