gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r30235 - gnunet/src/scalarproduct


From: gnunet
Subject: [GNUnet-SVN] r30235 - gnunet/src/scalarproduct
Date: Wed, 16 Oct 2013 22:29:10 +0200

Author: cfuchs
Date: 2013-10-16 22:29:10 +0200 (Wed, 16 Oct 2013)
New Revision: 30235

Modified:
   gnunet/src/scalarproduct/gnunet-service-scalarproduct.c
   gnunet/src/scalarproduct/test_scalarproduct.sh
Log:
complete testcase template, currently functionally blocked by two issues in the 
testbed profiler
renamed a couple of cariables



Modified: gnunet/src/scalarproduct/gnunet-service-scalarproduct.c
===================================================================
--- gnunet/src/scalarproduct/gnunet-service-scalarproduct.c     2013-10-16 
20:24:25 UTC (rev 30234)
+++ gnunet/src/scalarproduct/gnunet-service-scalarproduct.c     2013-10-16 
20:29:10 UTC (rev 30235)
@@ -1708,7 +1708,7 @@
     // get our peer ID
     memcpy (&session->peer, &msg->peer, sizeof (struct GNUNET_PeerIdentity));
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                _ ("Creating new tunnel to for session with key %s.\n"),
+                _ ("Creating new tunnel for session with key %s.\n"),
                 GNUNET_h2s (&session->key));
     session->tunnel = GNUNET_MESH_tunnel_create (my_mesh, session,
                                                  &session->peer,
@@ -1872,9 +1872,9 @@
   uint32_t count;
   gcry_mpi_t t;
   gcry_mpi_t u;
-  gcry_mpi_t utick;
+  gcry_mpi_t u_prime;
   gcry_mpi_t p;
-  gcry_mpi_t ptick;
+  gcry_mpi_t p_prime;
   gcry_mpi_t tmp;
   unsigned int i;
 
@@ -1902,12 +1902,12 @@
   gcry_mpi_release (tmp);
 
   //calculate U'
-  utick = gcry_mpi_new (0);
+  u_prime = gcry_mpi_new (0);
   tmp = compute_square_sum (session->r_prime, count);
-  gcry_mpi_sub (utick, utick, tmp);
+  gcry_mpi_sub (u_prime, u_prime, tmp);
 
   GNUNET_assert (p = gcry_mpi_new (0));
-  GNUNET_assert (ptick = gcry_mpi_new (0));
+  GNUNET_assert (p_prime = gcry_mpi_new (0));
 
   // compute P
   decrypt_element (session->s, session->s, my_mu, my_lambda, my_n, my_nsquare);
@@ -1918,16 +1918,16 @@
   gcry_mpi_add (p, p, u);
 
   // compute P'
-  gcry_mpi_add (ptick, session->s_prime, t);
-  gcry_mpi_add (ptick, ptick, utick);
+  gcry_mpi_add (p_prime, session->s_prime, t);
+  gcry_mpi_add (p_prime, p_prime, u_prime);
 
   gcry_mpi_release (t);
   gcry_mpi_release (u);
-  gcry_mpi_release (utick);
+  gcry_mpi_release (u_prime);
 
   // compute product
-  gcry_mpi_sub (p, p, ptick);
-  gcry_mpi_release (ptick);
+  gcry_mpi_sub (p, p, p_prime);
+  gcry_mpi_release (p_prime);
   tmp = gcry_mpi_set_ui (tmp, 2);
   gcry_mpi_div (p, NULL, p, tmp, 0);
 

Modified: gnunet/src/scalarproduct/test_scalarproduct.sh
===================================================================
--- gnunet/src/scalarproduct/test_scalarproduct.sh      2013-10-16 20:24:25 UTC 
(rev 30234)
+++ gnunet/src/scalarproduct/test_scalarproduct.sh      2013-10-16 20:29:10 UTC 
(rev 30235)
@@ -1,21 +1,33 @@
 #!/bin/bash
+# compute a simple scalar product
 
 #necessary to make the testing prefix deterministic, so we can access the 
config files
-GNUNET_TESTING_PREFIX=/tmp/test-scalarproduct`date +%H%M%S`
-CFGALICE="-c $GNUNET_TESTING_PREFIX/0/config"
-CFGBOB="-c $GNUNET_TESTING_PREFIX/1/config"
+PREFIX=/tmp/test-scalarproduct`date +%H%M%S`
 
-../testbed/gnunet-testbed-profiler -c test_scalarproduct.conf -p 2 
2>gnunet_error.log &
+#where can we find the peers config files?
+CFGALICE="-c $PREFIX/0/config"
+CFGBOB="-c $PREFIX/1/config"
+
+#log at which loglevel?
+LOG="-L ERROR"
+
+#launch two peers in line topology
+GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler $LOG -c 
test_scalarproduct.conf -p 2 2>gnunet_error.log &
 sleep 5
 
+#get bob's peer ID, necessary for alice
 PEERIDBOB=`gnunet-peerinfo -qs $CFGB`
+
+#payload for this test on both sides
 INPUTALICE="-k AAAA -e 10,10,10"
 INPUTBOB="-k AAAA -e 10,10,10"
-EXPECTED="2C0"
 
-gnunet-scalarproduct $CFGBOB $INPUTBOB
-RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB 
2>client_error.log`
+echo "gnunet-scalarproduct $LOG $CFGBOB $INPUTBOB &"
+echo "gnunet-scalarproduct $LOG $CFGALICE $INPUTALICE -p $PEERIDBOB -L ERROR"
+gnunet-scalarproduct $LOG $CFGBOB $INPUTBOB 2>bob_error.log &
+RESULT=`gnunet-scalarproduct $LOG $CFGALICE $INPUTALICE -p $PEERIDBOB 
2>alice_error.log`
 
+EXPECTED="12C"
 if [ "$RESULT" == "$EXPECTED" ]
 then
   echo "OK"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]