2 # compute a simple scalar product
3 # payload for this test:
4 INPUTALICE="-k CCC -e -3,-3,1"
5 INPUTBOB="-k CCC -e 1000,100,24"
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"
14 # launch two peers in line topology non-interactively
16 # interactive mode would terminate the test immediately
17 # because the rest of the script is already in stdin,
18 # thus redirecting stdin does not suffice)
19 GNUNET_LOG=';;;;DEBUG' GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 &
21 # sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe
24 # get bob's peer ID, necessary for alice
25 PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB`
27 GNUNET_LOG=';;;;DEBUG' gnunet-scalarproduct $CFGBOB $INPUTBOB &
28 RESULT=`GNUNET_LOG=';;;;DEBUG' gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
30 # terminate the testbed
34 if [ "$RESULT" == "$EXPECTED" ]
39 echo "Result $RESULT NOTOK"