gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29079 - in gnunet: doc src/consensus src/dht src/dv src/ex


From: gnunet
Subject: [GNUnet-SVN] r29079 - in gnunet: doc src/consensus src/dht src/dv src/experimentation src/fs src/gns src/include src/mesh src/nse src/regex src/testbed src/topology
Date: Fri, 6 Sep 2013 16:38:25 +0200

Author: harsha
Date: 2013-09-06 16:38:24 +0200 (Fri, 06 Sep 2013)
New Revision: 29079

Modified:
   gnunet/doc/testbed_test.c
   gnunet/src/consensus/gnunet-consensus-profiler.c
   gnunet/src/dht/dht_test_lib.c
   gnunet/src/dv/test_transport_blacklist.c
   gnunet/src/dv/test_transport_dv.c
   gnunet/src/experimentation/test_experimentation_clique_connect.c
   gnunet/src/experimentation/test_experimentation_clique_run.c
   gnunet/src/fs/gnunet-fs-profiler.c
   gnunet/src/fs/perf_gnunet_service_fs_p2p.c
   gnunet/src/fs/perf_gnunet_service_fs_p2p_respect.c
   gnunet/src/fs/test_fs_test_lib.c
   gnunet/src/fs/test_gnunet_service_fs_migration.c
   gnunet/src/fs/test_gnunet_service_fs_p2p.c
   gnunet/src/gns/test_gns_dht_three_peers.c
   gnunet/src/include/gnunet_testbed_service.h
   gnunet/src/mesh/mesh_test_lib.c
   gnunet/src/nse/gnunet-nse-profiler.c
   gnunet/src/nse/test_nse_multipeer.c
   gnunet/src/regex/gnunet-regex-profiler.c
   gnunet/src/testbed/gnunet-service-test-barriers.c
   gnunet/src/testbed/gnunet-testbed-profiler.c
   gnunet/src/testbed/test_testbed_api_barriers.c
   gnunet/src/testbed/test_testbed_api_peer_reconfiguration.c
   gnunet/src/testbed/test_testbed_api_peers_manage_services.c
   gnunet/src/testbed/test_testbed_api_statistics.c
   gnunet/src/testbed/test_testbed_api_test.c
   gnunet/src/testbed/test_testbed_api_test_timeout.c
   gnunet/src/testbed/test_testbed_api_testbed_run.c
   gnunet/src/testbed/test_testbed_api_topology.c
   gnunet/src/testbed/test_testbed_api_topology_clique.c
   gnunet/src/testbed/testbed_api_testbed.c
   gnunet/src/topology/test_gnunet_daemon_topology.c
Log:
- give out run handle through which master controller's handle can be retrieved


Modified: gnunet/doc/testbed_test.c
===================================================================
--- gnunet/doc/testbed_test.c   2013-09-06 14:04:24 UTC (rev 29078)
+++ gnunet/doc/testbed_test.c   2013-09-06 14:38:24 UTC (rev 29079)
@@ -131,13 +131,16 @@
  * just to the DHT service of peer 0.
  *
  * @param cls closure
+ * @param h the run handle
  * @param peers started peers for the test
  * @param num_peers size of the 'peers' array
  * @param links_succeeded number of links between peers that were created
  * @param links_failed number of links testbed was unable to establish
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls, 
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers,
              unsigned int links_succeeded,
              unsigned int links_failed)

Modified: gnunet/src/consensus/gnunet-consensus-profiler.c
===================================================================
--- gnunet/src/consensus/gnunet-consensus-profiler.c    2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/consensus/gnunet-consensus-profiler.c    2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -303,6 +303,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param started_peers handle to peers run in the testbed.  NULL upon timeout 
(see
  *          GNUNET_TESTBED_test_run()).
@@ -313,6 +314,7 @@
  */
 static void
 test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
              unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **started_peers,
              unsigned int links_succeeded,

Modified: gnunet/src/dht/dht_test_lib.c
===================================================================
--- gnunet/src/dht/dht_test_lib.c       2013-09-06 14:04:24 UTC (rev 29078)
+++ gnunet/src/dht/dht_test_lib.c       2013-09-06 14:38:24 UTC (rev 29079)
@@ -159,6 +159,7 @@
 
 static void
 dht_test_run (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
              unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers,
               unsigned int links_succeeded,

Modified: gnunet/src/dv/test_transport_blacklist.c
===================================================================
--- gnunet/src/dv/test_transport_blacklist.c    2013-09-06 14:04:24 UTC (rev 
29078)
+++ gnunet/src/dv/test_transport_blacklist.c    2013-09-06 14:38:24 UTC (rev 
29079)
@@ -33,6 +33,7 @@
 
 static void
 test_connection (void *cls,
+                 struct GNUNET_TESTBED_RunHandle *h,
                 unsigned int num_peers,
                 struct GNUNET_TESTBED_Peer **peers,
                  unsigned int links_succeeded,

Modified: gnunet/src/dv/test_transport_dv.c
===================================================================
--- gnunet/src/dv/test_transport_dv.c   2013-09-06 14:04:24 UTC (rev 29078)
+++ gnunet/src/dv/test_transport_dv.c   2013-09-06 14:38:24 UTC (rev 29079)
@@ -33,6 +33,7 @@
 
 static void
 test_connection (void *cls,
+                 struct GNUNET_TESTBED_RunHandle *h,
                 unsigned int num_peers,
                 struct GNUNET_TESTBED_Peer **peers,
                  unsigned int links_succeeded,

Modified: gnunet/src/experimentation/test_experimentation_clique_connect.c
===================================================================
--- gnunet/src/experimentation/test_experimentation_clique_connect.c    
2013-09-06 14:04:24 UTC (rev 29078)
+++ gnunet/src/experimentation/test_experimentation_clique_connect.c    
2013-09-06 14:38:24 UTC (rev 29079)
@@ -345,6 +345,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers_ handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -353,7 +354,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls, 
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)

Modified: gnunet/src/experimentation/test_experimentation_clique_run.c
===================================================================
--- gnunet/src/experimentation/test_experimentation_clique_run.c        
2013-09-06 14:04:24 UTC (rev 29078)
+++ gnunet/src/experimentation/test_experimentation_clique_run.c        
2013-09-06 14:38:24 UTC (rev 29079)
@@ -318,6 +318,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers_ handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -326,7 +327,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)

Modified: gnunet/src/fs/gnunet-fs-profiler.c
===================================================================
--- gnunet/src/fs/gnunet-fs-profiler.c  2013-09-06 14:04:24 UTC (rev 29078)
+++ gnunet/src/fs/gnunet-fs-profiler.c  2013-09-06 14:38:24 UTC (rev 29079)
@@ -128,6 +128,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -136,7 +137,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers, 
+test_master (void *cls, 
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers,
              unsigned int links_succeeded,
              unsigned int links_failed)

Modified: gnunet/src/fs/perf_gnunet_service_fs_p2p.c
===================================================================
--- gnunet/src/fs/perf_gnunet_service_fs_p2p.c  2013-09-06 14:04:24 UTC (rev 
29078)
+++ gnunet/src/fs/perf_gnunet_service_fs_p2p.c  2013-09-06 14:38:24 UTC (rev 
29079)
@@ -304,7 +304,8 @@
 
 
 static void
-do_publish (void *cls, 
+do_publish (void *cls,
+            struct GNUNET_TESTBED_RunHandle *h,
            unsigned int num_peers,
            struct GNUNET_TESTBED_Peer **peers,
             unsigned int links_succeeded,

Modified: gnunet/src/fs/perf_gnunet_service_fs_p2p_respect.c
===================================================================
--- gnunet/src/fs/perf_gnunet_service_fs_p2p_respect.c  2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/fs/perf_gnunet_service_fs_p2p_respect.c  2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -434,6 +434,7 @@
 
 static void
 do_connect (void *cls, 
+            struct GNUNET_TESTBED_RunHandle *h,
            unsigned int num_peers,
            struct GNUNET_TESTBED_Peer **peers,
             unsigned int links_succeeded,

Modified: gnunet/src/fs/test_fs_test_lib.c
===================================================================
--- gnunet/src/fs/test_fs_test_lib.c    2013-09-06 14:04:24 UTC (rev 29078)
+++ gnunet/src/fs/test_fs_test_lib.c    2013-09-06 14:38:24 UTC (rev 29079)
@@ -115,6 +115,7 @@
  * Actual main function for the test.
  * 
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -124,6 +125,7 @@
  */
 static void
 run (void *cls, 
+     struct GNUNET_TESTBED_RunHandle *h,
      unsigned int num_peers,
      struct GNUNET_TESTBED_Peer **peers,
      unsigned int links_succeeded,

Modified: gnunet/src/fs/test_gnunet_service_fs_migration.c
===================================================================
--- gnunet/src/fs/test_gnunet_service_fs_migration.c    2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/fs/test_gnunet_service_fs_migration.c    2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -161,6 +161,7 @@
 
 static void
 do_publish (void *cls, 
+            struct GNUNET_TESTBED_RunHandle *h,
            unsigned int num_peers,
            struct GNUNET_TESTBED_Peer **peers,
             unsigned int links_succeeded,

Modified: gnunet/src/fs/test_gnunet_service_fs_p2p.c
===================================================================
--- gnunet/src/fs/test_gnunet_service_fs_p2p.c  2013-09-06 14:04:24 UTC (rev 
29078)
+++ gnunet/src/fs/test_gnunet_service_fs_p2p.c  2013-09-06 14:38:24 UTC (rev 
29079)
@@ -114,6 +114,7 @@
 
 static void
 do_publish (void *cls,
+            struct GNUNET_TESTBED_RunHandle *h,
            unsigned int num_peers,
            struct GNUNET_TESTBED_Peer **peers,
             unsigned int links_succeeded,

Modified: gnunet/src/gns/test_gns_dht_three_peers.c
===================================================================
--- gnunet/src/gns/test_gns_dht_three_peers.c   2013-09-06 14:04:24 UTC (rev 
29078)
+++ gnunet/src/gns/test_gns_dht_three_peers.c   2013-09-06 14:38:24 UTC (rev 
29079)
@@ -596,6 +596,7 @@
 
 
 void testbed_master (void *cls,
+                     struct GNUNET_TESTBED_RunHandle *h,
                      unsigned int num_peers,
                      struct GNUNET_TESTBED_Peer **peers,
                      unsigned int links_succeeded,

Modified: gnunet/src/include/gnunet_testbed_service.h
===================================================================
--- gnunet/src/include/gnunet_testbed_service.h 2013-09-06 14:04:24 UTC (rev 
29078)
+++ gnunet/src/include/gnunet_testbed_service.h 2013-09-06 14:38:24 UTC (rev 
29079)
@@ -1328,11 +1328,16 @@
                                GNUNET_TESTBED_OperationCompletionCallback cont,
                                void *cls);
 
+/**
+ * Handle for testbed run helper funtions
+ */
+struct GNUNET_TESTBED_RunHandle;
 
 /**
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers handle to peers run in the testbed.  NULL upon timeout (see
  *          GNUNET_TESTBED_test_run()).
@@ -1340,8 +1345,10 @@
  *          succeeded
  * @param links_failed the number of overlay link connection attempts that
  *          failed
+ * @see GNUNET_TESTBED_test_run()
  */
 typedef void (*GNUNET_TESTBED_TestMaster)(void *cls,
+                                          struct GNUNET_TESTBED_RunHandle *h,
                                           unsigned int num_peers,
                                           struct GNUNET_TESTBED_Peer **peers,
                                           unsigned int links_succeeded,
@@ -1442,6 +1449,16 @@
 
 
 /**
+ * Obtain handle to the master controller from a testbed run.  The handle
+ * returned should not be disconnected.
+ *
+ * @param h the testbed run handle
+ * @return handle to the master controller
+ */
+struct GNUNET_TESTBED_Controller *
+GNUNET_TESTBED_run_get_controller_handle (struct GNUNET_TESTBED_RunHandle *h);
+
+/**
  * Opaque handle for barrier
  */
 struct GNUNET_TESTBED_Barrier;

Modified: gnunet/src/mesh/mesh_test_lib.c
===================================================================
--- gnunet/src/mesh/mesh_test_lib.c     2013-09-06 14:04:24 UTC (rev 29078)
+++ gnunet/src/mesh/mesh_test_lib.c     2013-09-06 14:38:24 UTC (rev 29079)
@@ -213,6 +213,7 @@
  * each other)
  * 
  * @param cls Closure (context).
+ * @param h the run handle
  * @param num_peers Number of peers that are running.
  * @param peers Handles to each one of the @c num_peers peers.
  * @param links_succeeded the number of overlay link connection attempts that
@@ -222,6 +223,7 @@
  */
 static void
 mesh_test_run (void *cls,
+               struct GNUNET_TESTBED_RunHandle *h,
                unsigned int num_peers,
                struct GNUNET_TESTBED_Peer **peers,
                unsigned int links_succeeded,

Modified: gnunet/src/nse/gnunet-nse-profiler.c
===================================================================
--- gnunet/src/nse/gnunet-nse-profiler.c        2013-09-06 14:04:24 UTC (rev 
29078)
+++ gnunet/src/nse/gnunet-nse-profiler.c        2013-09-06 14:38:24 UTC (rev 
29079)
@@ -757,6 +757,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls NULL
+ * @param h the run handle
  * @param num_peers_ number of peers in 'peers'
  * @param peers handle to peers run in the testbed.  NULL upon timeout (see
  *          GNUNET_TESTBED_test_run()).
@@ -767,6 +768,7 @@
  */
 static void 
 test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
              unsigned int num_peers_,
              struct GNUNET_TESTBED_Peer **peers,
              unsigned int links_succeeded,

Modified: gnunet/src/nse/test_nse_multipeer.c
===================================================================
--- gnunet/src/nse/test_nse_multipeer.c 2013-09-06 14:04:24 UTC (rev 29078)
+++ gnunet/src/nse/test_nse_multipeer.c 2013-09-06 14:38:24 UTC (rev 29079)
@@ -179,6 +179,7 @@
  * Actual "main" function for the testcase.
  * 
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -188,6 +189,7 @@
  */
 static void
 run (void *cls,
+     struct GNUNET_TESTBED_RunHandle *h,
      unsigned int num_peers,
      struct GNUNET_TESTBED_Peer **peers,
      unsigned int links_succeeded,

Modified: gnunet/src/regex/gnunet-regex-profiler.c
===================================================================
--- gnunet/src/regex/gnunet-regex-profiler.c    2013-09-06 14:04:24 UTC (rev 
29078)
+++ gnunet/src/regex/gnunet-regex-profiler.c    2013-09-06 14:38:24 UTC (rev 
29079)
@@ -1097,6 +1097,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls NULL
+ * @param h the run handle
  * @param num_peers_ number of peers in 'peers'
  * @param testbed_peers handle to peers run in the testbed.  NULL upon timeout 
(see
  *          GNUNET_TESTBED_test_run()).
@@ -1107,6 +1108,7 @@
  */
 static void 
 test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
              unsigned int num_peers_,
              struct GNUNET_TESTBED_Peer **testbed_peers,
              unsigned int links_succeeded,

Modified: gnunet/src/testbed/gnunet-service-test-barriers.c
===================================================================
--- gnunet/src/testbed/gnunet-service-test-barriers.c   2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/testbed/gnunet-service-test-barriers.c   2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -20,8 +20,8 @@
 
 /**
  * @file testbed/gnunet-service-test-barriers.c
- * @brief Service for testing testbed barriers.  This service is started as a
- *   peer service and waits for a barrier to be crossed.
+ * @brief Daemon acting as a service for testing testbed barriers.  It is
+ *   started as a peer service and waits for a barrier to be crossed.
  * @author Sree Harsha Totakura <address@hidden> 
  */
 

Modified: gnunet/src/testbed/gnunet-testbed-profiler.c
===================================================================
--- gnunet/src/testbed/gnunet-testbed-profiler.c        2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/testbed/gnunet-testbed-profiler.c        2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -209,6 +209,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -216,7 +217,9 @@
  * @param links_failed the number of overlay link
  */
 static void
-test_run (void *cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer 
**peers,
+test_run (void *cls, 
+          struct GNUNET_TESTBED_RunHandle *h,
+          unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers,
           unsigned int links_succeeded,
           unsigned int links_failed)
 {

Modified: gnunet/src/testbed/test_testbed_api_barriers.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_barriers.c      2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/testbed/test_testbed_api_barriers.c      2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -24,8 +24,74 @@
  * @author Sree Harsha Totakura <address@hidden> 
  */
 
+#include "platform.h"
+#include "gnunet_util_lib.h"
+#include "gnunet_testbed_service.h"
 
-int main ()
+/**
+ * Number of peers we start in this test case
+ */
+#define NUM_PEERS 3
+
+/**
+ * Result of this test case
+ */
+static int result;
+
+
+/**
+ * Signature of a main function for a testcase.
+ *
+ * @param cls closure
+ * @param h the run handle
+ * @param num_peers number of peers in 'peers'
+ * @param peers_ handle to peers run in the testbed
+ * @param links_succeeded the number of overlay link connection attempts that
+ *          succeeded
+ * @param links_failed the number of overlay link connection attempts that
+ *          failed
+ */
+static void
+test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
+             struct GNUNET_TESTBED_Peer **peers_,
+             unsigned int links_succeeded,
+             unsigned int links_failed)
 {
+
+  GNUNET_assert (NULL == cls);
+  if (NULL == peers_)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failing test due to timeout\n");
+    return;
+  }
+  GNUNET_assert (NUM_PEERS == num_peers);
+  
+  result = GNUNET_OK;
+  GNUNET_SCHEDULER_shutdown ();
+  /* shutdown_task = */
+  /*     GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply */
+  /*                                   (GNUNET_TIME_UNIT_SECONDS, 300), */
+  /*                                   do_shutdown, NULL); */
+}
+
+
+/**
+ * Main function
+ */
+int
+main (int argc, char **argv)
+{
+  uint64_t event_mask;
+
+  result = GNUNET_SYSERR;
+  event_mask = 0;
+  (void) GNUNET_TESTBED_test_run ("test_testbed_api_test",
+                                  "test_testbed_api_barriers.conf", NUM_PEERS,
+                                  event_mask, NULL, NULL,
+                                  &test_master, NULL);
+  if (GNUNET_OK != result)
+    return 1;
   return 0;
 }

Modified: gnunet/src/testbed/test_testbed_api_peer_reconfiguration.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_peer_reconfiguration.c  2013-09-06 
14:04:24 UTC (rev 29078)
+++ gnunet/src/testbed/test_testbed_api_peer_reconfiguration.c  2013-09-06 
14:38:24 UTC (rev 29079)
@@ -143,6 +143,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers_ handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -151,7 +152,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls, 
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)

Modified: gnunet/src/testbed/test_testbed_api_peers_manage_services.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_peers_manage_services.c 2013-09-06 
14:04:24 UTC (rev 29078)
+++ gnunet/src/testbed/test_testbed_api_peers_manage_services.c 2013-09-06 
14:38:24 UTC (rev 29079)
@@ -164,6 +164,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers_ handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -172,7 +173,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)

Modified: gnunet/src/testbed/test_testbed_api_statistics.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_statistics.c    2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/testbed/test_testbed_api_statistics.c    2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -159,6 +159,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers_ handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -167,7 +168,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)

Modified: gnunet/src/testbed/test_testbed_api_test.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_test.c  2013-09-06 14:04:24 UTC (rev 
29078)
+++ gnunet/src/testbed/test_testbed_api_test.c  2013-09-06 14:38:24 UTC (rev 
29079)
@@ -193,6 +193,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers- handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -201,7 +202,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)

Modified: gnunet/src/testbed/test_testbed_api_test_timeout.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_test_timeout.c  2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/testbed/test_testbed_api_test_timeout.c  2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -78,6 +78,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers- handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -86,7 +87,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)

Modified: gnunet/src/testbed/test_testbed_api_testbed_run.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_testbed_run.c   2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/testbed/test_testbed_api_testbed_run.c   2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -98,6 +98,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers_ handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -106,7 +107,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls, 
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)

Modified: gnunet/src/testbed/test_testbed_api_topology.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_topology.c      2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/testbed/test_testbed_api_topology.c      2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -119,6 +119,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers_ handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -127,7 +128,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)
@@ -135,8 +138,12 @@
   unsigned int peer;
 
   GNUNET_assert (NULL == cls);
+  if (NULL == peers_)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failing test due to timeout\n");
+    return;
+  }
   GNUNET_assert (NUM_PEERS == num_peers);
-  GNUNET_assert (NULL != peers_);
   for (peer = 0; peer < num_peers; peer++)
     GNUNET_assert (NULL != peers_[peer]);
   peers = peers_;

Modified: gnunet/src/testbed/test_testbed_api_topology_clique.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_topology_clique.c       2013-09-06 
14:04:24 UTC (rev 29078)
+++ gnunet/src/testbed/test_testbed_api_topology_clique.c       2013-09-06 
14:38:24 UTC (rev 29079)
@@ -114,6 +114,7 @@
  * Signature of a main function for a testcase.
  *
  * @param cls closure
+ * @param h the run handle
  * @param num_peers number of peers in 'peers'
  * @param peers_ handle to peers run in the testbed
  * @param links_succeeded the number of overlay link connection attempts that
@@ -122,7 +123,9 @@
  *          failed
  */
 static void
-test_master (void *cls, unsigned int num_peers,
+test_master (void *cls,
+             struct GNUNET_TESTBED_RunHandle *h,
+             unsigned int num_peers,
              struct GNUNET_TESTBED_Peer **peers_,
              unsigned int links_succeeded,
              unsigned int links_failed)
@@ -130,8 +133,12 @@
   unsigned int peer;
 
   GNUNET_assert (NULL == cls);
+  if (NULL == peers_)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failing test due to timeout\n");
+    return;
+  }
   GNUNET_assert (NUM_PEERS == num_peers);
-  GNUNET_assert (NULL != peers_);
   for (peer = 0; peer < num_peers; peer++)
     GNUNET_assert (NULL != peers_[peer]);
   peers = peers_;

Modified: gnunet/src/testbed/testbed_api_testbed.c
===================================================================
--- gnunet/src/testbed/testbed_api_testbed.c    2013-09-06 14:04:24 UTC (rev 
29078)
+++ gnunet/src/testbed/testbed_api_testbed.c    2013-09-06 14:38:24 UTC (rev 
29079)
@@ -50,10 +50,6 @@
  */
 #define DEFAULT_SETUP_TIMEOUT 300
 
-/**
- * Testbed Run Handle
- */
-struct RunContext;
 
 /**
  * Context information for the operation we start
@@ -68,7 +64,7 @@
   /**
    * Context information for GNUNET_TESTBED_run()
    */
-  struct RunContext *rc;
+  struct GNUNET_TESTBED_RunHandle *rc;
 
   /**
    * Closure
@@ -130,7 +126,7 @@
   /**
    * The run context
    */
-  struct RunContext *rc;
+  struct GNUNET_TESTBED_RunHandle *rc;
 
   /**
    * Handle for the compability check
@@ -147,7 +143,7 @@
 /**
  * Testbed Run Handle
  */
-struct RunContext
+struct GNUNET_TESTBED_RunHandle
 {
   /**
    * The controller handle
@@ -381,7 +377,7 @@
  * @return the matching RunContextOperation if found; NULL if not
  */
 static struct RunContextOperation *
-search_rcop (struct RunContext *rc, struct GNUNET_TESTBED_Operation *op)
+search_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct 
GNUNET_TESTBED_Operation *op)
 {
   struct SearchContext sc;
   
@@ -407,7 +403,7 @@
  * @param rcop the RunContextOperation to insert
  */
 static void
-insert_rcop (struct RunContext *rc, struct RunContextOperation *rcop)
+insert_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct RunContextOperation 
*rcop)
 {
   GNUNET_assert (GNUNET_OK ==
                  GNUNET_CONTAINER_multihashmap32_put (rc->rcop_map,
@@ -424,7 +420,7 @@
  * @param rcop the RunContextOperation
  */
 static void
-remove_rcop (struct RunContext *rc, struct RunContextOperation *rcop)
+remove_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct RunContextOperation 
*rcop)
 {
   GNUNET_assert (GNUNET_YES ==
                  GNUNET_CONTAINER_multihashmap32_remove (rc->rcop_map,
@@ -440,7 +436,7 @@
 static void
 cleanup (void *cls)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
   unsigned int hid;
 
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rc->register_hosts_task);
@@ -478,7 +474,7 @@
 static int
 rcop_cleanup_iterator (void *cls, uint32_t key, void *value)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
   struct RunContextOperation *rcop = value;
 
   GNUNET_assert (rc == rcop->rc);
@@ -495,7 +491,7 @@
  * @param rc the RunContext
  */
 static void
-rc_cleanup_operations (struct RunContext *rc)
+rc_cleanup_operations (struct GNUNET_TESTBED_RunHandle *rc)
 {
   struct CompatibilityCheckContext *hc;
   unsigned int nhost;
@@ -546,7 +542,7 @@
  * @param rc the run context
  */
 static void
-cancel_interrupt_task (struct RunContext *rc)
+cancel_interrupt_task (struct GNUNET_TESTBED_RunHandle *rc)
 {
   GNUNET_SCHEDULER_cancel (rc->interrupt_task);
   rc->interrupt_task = GNUNET_SCHEDULER_NO_TASK;
@@ -562,7 +558,7 @@
 static void
 wait_op_completion (void *cls)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
   struct RunContextOperation *rcop;
 
   if ( (NULL == rc->cproc)
@@ -604,7 +600,7 @@
 static void
 interrupt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
   struct GNUNET_TESTBED_Controller *c = rc->c;
   unsigned int size;
 
@@ -634,7 +630,7 @@
  * @return the representation string; this is NOT reentrant
  */
 static const char *
-prof_time (struct RunContext *rc)
+prof_time (struct GNUNET_TESTBED_RunHandle *rc)
 {
   struct GNUNET_TIME_Relative ptime;
 
@@ -652,7 +648,7 @@
 static void
 start_peers_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
   struct RunContextOperation *rcop;
   unsigned int peer;
 
@@ -684,7 +680,7 @@
 peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg)
 {
   struct RunContextOperation *rcop = cls;
-  struct RunContext *rc;
+  struct GNUNET_TESTBED_RunHandle *rc;
 
   GNUNET_assert (NULL != rcop);
   GNUNET_assert (NULL != (rc = rcop->rc));
@@ -715,12 +711,12 @@
  * @param rc the RunContext
  */
 static void
-call_master (struct RunContext *rc)
+call_master (struct GNUNET_TESTBED_RunHandle *rc)
 {
   GNUNET_SCHEDULER_cancel (rc->timeout_task);
   rc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
   if (NULL != rc->test_master)
-    rc->test_master (rc->test_master_cls, rc->num_peers, rc->peers,
+    rc->test_master (rc->test_master_cls, rc, rc->num_peers, rc->peers,
                      rc->links_succeeded, rc->links_failed);
 }
 
@@ -738,7 +734,7 @@
 topology_completion_callback (void *cls, unsigned int nsuccess,
                               unsigned int nfailures)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
 
   DEBUG ("Overlay topology generated in %s\n", prof_time (rc));
   GNUNET_TESTBED_operation_done (rc->topology_operation);
@@ -756,7 +752,7 @@
  * @param rc the RunContext
  */
 static void
-create_peers (struct RunContext *rc)
+create_peers (struct GNUNET_TESTBED_RunHandle *rc)
 {
   struct RunContextOperation *rcop;
   unsigned int peer;
@@ -793,7 +789,7 @@
 static void
 event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
   struct RunContextOperation *rcop;
 
   if (RC_INIT == rc->state)
@@ -940,7 +936,7 @@
 static void
 host_registration_completion (void *cls, const char *emsg)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
 
   rc->reg_handle = NULL;
   if (NULL != emsg)
@@ -963,7 +959,7 @@
 static void
 register_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
   struct RunContextOperation *rcop;
   unsigned int slave;
 
@@ -1005,7 +1001,7 @@
 controller_status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg,
                       int status)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
   uint64_t event_mask;
 
   if (status != GNUNET_OK)
@@ -1052,7 +1048,7 @@
              const struct sockaddr *addr, const struct sockaddr 
*broadcast_addr,
              const struct sockaddr *netmask, socklen_t addrlen)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
   char hostip[NI_MAXHOST];
   char *buf;
 
@@ -1088,7 +1084,7 @@
                    int status)
 {
   struct CompatibilityCheckContext *hc = cls;
-  struct RunContext *rc;
+  struct GNUNET_TESTBED_RunHandle *rc;
   struct GNUNET_TESTBED_Host **old_hosts;
   unsigned int nhost;
 
@@ -1157,13 +1153,13 @@
 static void
 timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  struct RunContext *rc = cls;
+  struct GNUNET_TESTBED_RunHandle *rc = cls;
   
   rc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
   LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while 
setup.\n"));
    GNUNET_SCHEDULER_shutdown ();
    if (NULL != rc->test_master)
-     rc->test_master (rc->test_master_cls, 0, NULL, 0, 0);
+     rc->test_master (rc->test_master_cls, rc, 0, NULL, 0, 0);
    rc->test_master = NULL;
 }
 
@@ -1203,7 +1199,7 @@
                     GNUNET_TESTBED_TestMaster test_master,
                     void *test_master_cls)
 {
-  struct RunContext *rc;
+  struct GNUNET_TESTBED_RunHandle *rc;
   char *topology;
   struct CompatibilityCheckContext *hc;      
   struct GNUNET_TIME_Relative timeout;
@@ -1212,7 +1208,7 @@
   unsigned int nhost;
 
   GNUNET_assert (num_peers > 0);
-  rc = GNUNET_malloc (sizeof (struct RunContext));
+  rc = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_RunHandle));
   rc->cfg = GNUNET_CONFIGURATION_dup (cfg);
 #if ENABLE_LL
   rc->num_hosts = GNUNET_TESTBED_hosts_load_from_loadleveler (rc->cfg,

Modified: gnunet/src/topology/test_gnunet_daemon_topology.c
===================================================================
--- gnunet/src/topology/test_gnunet_daemon_topology.c   2013-09-06 14:04:24 UTC 
(rev 29078)
+++ gnunet/src/topology/test_gnunet_daemon_topology.c   2013-09-06 14:38:24 UTC 
(rev 29079)
@@ -62,7 +62,8 @@
 
 
 static void
-do_connect (void *cls, 
+do_connect (void *cls,
+            struct GNUNET_TESTBED_RunHandle *h, 
            unsigned int num_peers,
            struct GNUNET_TESTBED_Peer **peers,
             unsigned int links_succeeded,




reply via email to

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