more work on the sp_test
authorChristian Fuchs <christian.fuchs@cfuchs.net>
Tue, 15 Oct 2013 15:28:33 +0000 (15:28 +0000)
committerChristian Fuchs <christian.fuchs@cfuchs.net>
Tue, 15 Oct 2013 15:28:33 +0000 (15:28 +0000)
src/scalarproduct/test_scalarproduct.sh

index ee828e4aae4b457a342f4ebb5e5052d647bc0a5b..0ac0d82fcb0997e5d666886b29b2a4fa92404a40 100755 (executable)
@@ -1,26 +1,20 @@
 #!/bin/bash
 
 #necessary to make the testing prefix deterministic, so we can access the config files
-GNUNET_TESTING_PREFIX=/tmp/test-scalarproduct1337
-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
+GNUNET_TESTING_PREFIX=/tmp/test-scalarproduct`date +%H%M%S`
+CFGALICE="-c $GNUNET_TESTING_PREFIX/0/config"
+CFGBOB="-c $GNUNET_TESTING_PREFIX/1/config"
 
-IDB=`gnunet-peerinfo -s $CFGB | awk -F "\x60" '{print $2}' | awk -F "'" '{print $1}'`
+../testbed/gnunet-testbed-profiler -c test_scalarproduct.conf -p 2 2>gnunet_error.log &
+sleep 5
 
-gnunet-scalarproduct $CFGB $SESSIONDATA
-
-RESULT=`gnunet-scalarproduct $CFGA $SESSIONDATA -p $IDB`
+PEERIDBOB=`gnunet-peerinfo -qs $CFGB`
+INPUTALICE="-k AAAA -e 10,10,10"
+INPUTBOB="-k AAAA -e 10,10,10"
+EXPECTED="2C0"
 
-gnunet-arm -e $CFGA &
-gnunet-arm -e $CFGB &
+gnunet-scalarproduct $CFGBOB $INPUTBOB
+RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB 2>client_error.log`
 
 if [ "$RESULT" == "$EXPECTED" ]
 then