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"
7 # necessary to make the testing prefix deterministic, so we can access the config files
8 PREFIX=/tmp/test-scalarproduct`date +%H%M%S`
10 # where can we find the peers config files?
11 CFGALICE="-c $PREFIX/0/config"
12 CFGBOB="-c $PREFIX/1/config"
13 # log at which loglevel?
17 # launch two peers in line topology non-interactively
19 # interactive mode would terminate the test immediately
20 # because the rest of the script is already in stdin,
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 &
26 # get bob's peer ID, necessary for alice
27 PEERIDBOB=`gnunet-peerinfo -qs $CFGB`
30 GNUNET_LOG="scalarproduct;;;;$LOGLEVEL" gnunet-scalarproduct $CFGBOB $INPUTBOB 2>bob.log &
32 GNUNET_LOG="scalarproduct;;;;$LOGLEVEL" gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB 2>alice.log
35 # termiante the testbed
36 kill $( pgrep -P $$ | tr '\n' ' ' )
40 if [ "$RESULT" == "$EXPECTED" ]
45 echo "Result $RESULT NOTOK"