X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fscalarproduct%2Ftest_scalarproduct.sh;h=eed9de30fe41cedf3c8d5559da1708917353a978;hb=cea95af17bb3bfaf65224d0ecd2db2308e333764;hp=5ba94f6416b89c7efed8a3c318bbc91a094c6f95;hpb=49dae49c8a2bf3682e20365f026fc087d27937e9;p=oweals%2Fgnunet.git diff --git a/src/scalarproduct/test_scalarproduct.sh b/src/scalarproduct/test_scalarproduct.sh index 5ba94f641..eed9de30f 100755 --- a/src/scalarproduct/test_scalarproduct.sh +++ b/src/scalarproduct/test_scalarproduct.sh @@ -1,8 +1,8 @@ #!/bin/bash # compute a simple scalar product # payload for this test: -INPUTALICE="-k CCC -e 3,3,-1" -INPUTBOB="-k CCC -e 1000,100,24" +INPUTALICE="-k CCC -e 'AB,10;RO,3;FL,3;LOL,-1;'" +INPUTBOB="-k CCC -e 'BC,-20000;RO,1000;FL,100;LOL,24;'" # necessary to make the testing prefix deterministic, so we can access the config files PREFIX=/tmp/test-scalarproduct`date +%H%M%S` @@ -13,10 +13,11 @@ CFGBOB="-c $PREFIX/1/config" # launch two peers in line topology non-interactively # -# interactive mode would terminate the test immediately -# because the rest of the script is already in stdin, +# interactive mode would terminate the test immediately +# because the rest of the script is already in stdin, # thus redirecting stdin does not suffice) -GNUNET_LOG='scalarproduct;;;;DEBUG' GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 & +#GNUNET_LOG='scalarproduct;;;;DEBUG' +GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 & PID=$! # sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe sleep 5 @@ -24,11 +25,13 @@ sleep 5 # get bob's peer ID, necessary for alice PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB` -GNUNET_LOG=';;;;DEBUG' gnunet-scalarproduct $CFGBOB $INPUTBOB & -RESULT=`GNUNET_LOG=';;;;DEBUG' gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB` +#GNUNET_LOG=';;;;DEBUG' +gnunet-scalarproduct $CFGBOB $INPUTBOB & +GNUNET_LOG=';;;;DEBUG' +RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB` # terminate the testbed -kill $PID +kill $PID EXPECTED="0CCC" if [ "$RESULT" == "$EXPECTED" ]