2 # compute a simple scalar product
3 # payload for this test:
5 INPUTALICE="-k CCC -e '"
9 INPUTALICE="${INPUTALICE}A${X},$X;"
10 INPUTBOB="${INPUTBOB}A${X},$X;"
12 INPUTALICE="${INPUTALICE}BC,-20000;RO,1000;FL,100;LOL,24;'"
13 INPUTBOB="${INPUTBOB}AB,10;RO,3;FL,3;LOL,-1;'"
15 # necessary to make the testing prefix deterministic, so we can access the config files
16 PREFIX=/tmp/test-scalarproduct`date +%H%M%S`
18 # where can we find the peers config files?
19 CFGALICE="-c $PREFIX/0/config"
20 CFGBOB="-c $PREFIX/1/config"
22 # launch two peers in line topology non-interactively
24 # interactive mode would terminate the test immediately
25 # because the rest of the script is already in stdin,
26 # thus redirecting stdin does not suffice)
27 GNUNET_FORCE_LOG=';;;;ERROR'
28 GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 &
30 # sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe
31 echo "Waiting for peers to start..."
33 # get Bob's peer ID, necessary for Alice
34 PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB`
36 echo "Running problem of size $SIZE"
37 gnunet-scalarproduct $CFGBOB $INPUTBOB &
38 time RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
40 echo "Terminating testbed..."
41 # terminate the testbed