removed old, deprecated SP tests
[oweals/gnunet.git] / src / scalarproduct / test_scalarproduct.sh
1 #!/bin/bash
2
3 CFGA="-c ./test_scalarproduct_alice.conf"
4 CFGB="-c ./test_scalarproduct_bob.conf"
5                                         #can't use ` directly
6 SESSIONDATA="-k AAAA -e 10,10,10"
7 EXPECTED="2C0"
8
9 gnunet-arm -s $CFGA
10 sleep 2
11 gnunet-arm -s $CFGB
12 sleep 2
13
14 IDB=`gnunet-peerinfo -s $CFGB | awk -F "\x60" '{print $2}' | awk -F "'" '{print $1}'`
15
16 gnunet-scalarproduct $CFGB $SESSIONDATA
17
18 RESULT=`gnunet-scalarproduct $CFGA $SESSIONDATA -p $IDB`
19
20 gnunet-arm -e $CFGA &
21 gnunet-arm -e $CFGB &
22
23 if [ "$RESULT" == "$EXPECTED" ]
24 then
25   echo "OK"
26   exit 0
27 else
28   echo "Result $RESULT NOTOK"
29   exit 1
30 fi
31