From f605b91f795d125009fd402dc92fdae987e3c012 Mon Sep 17 00:00:00 2001 From: Christian Fuchs Date: Tue, 17 Sep 2013 14:41:39 +0000 Subject: removed old, deprecated SP tests added new test which is only a bash script and computes the vectorproduct. TODO: proper logging output, add a second test that kills one service instance --- src/scalarproduct/test_scalarproduct.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 src/scalarproduct/test_scalarproduct.sh (limited to 'src/scalarproduct/test_scalarproduct.sh') diff --git a/src/scalarproduct/test_scalarproduct.sh b/src/scalarproduct/test_scalarproduct.sh new file mode 100755 index 000000000..81bd9c2ec --- /dev/null +++ b/src/scalarproduct/test_scalarproduct.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +CFGA="-c ./test_scalarproduct_alice.conf" +CFGB="-c ./test_scalarproduct_bob.conf" + #can't use ` directly +SESSIONDATA="-k AAAA -e 10,10,10" +EXPECTED="2C0" + +gnunet-arm -s $CFGA +sleep 2 +gnunet-arm -s $CFGB +sleep 2 + +IDB=`gnunet-peerinfo -s $CFGB | awk -F "\x60" '{print $2}' | awk -F "'" '{print $1}'` + +gnunet-scalarproduct $CFGB $SESSIONDATA + +RESULT=`gnunet-scalarproduct $CFGA $SESSIONDATA -p $IDB` + +gnunet-arm -e $CFGA & +gnunet-arm -e $CFGB & + +if [ "$RESULT" == "$EXPECTED" ] +then + echo "OK" + exit 0 +else + echo "Result $RESULT NOTOK" + exit 1 +fi + -- cgit v1.2.3