gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r26839 - in gnunet/src: include regex testbed


From: gnunet
Subject: [GNUnet-SVN] r26839 - in gnunet/src: include regex testbed
Date: Wed, 10 Apr 2013 16:25:55 +0200

Author: harsha
Date: 2013-04-10 16:25:55 +0200 (Wed, 10 Apr 2013)
New Revision: 26839

Modified:
   gnunet/src/include/gnunet_testbed_service.h
   gnunet/src/regex/gnunet-regex-profiler.c
   gnunet/src/testbed/gnunet-service-testbed_links.c
   gnunet/src/testbed/test_testbed_api.c
   gnunet/src/testbed/test_testbed_api_2peers_1controller.c
   gnunet/src/testbed/test_testbed_api_3peers_3controllers.c
   gnunet/src/testbed/test_testbed_api_controllerlink.c
   gnunet/src/testbed/testbed_api.c
   gnunet/src/testbed/testbed_api_testbed.c
Log:
- use host's configuration while connecting to controller


Modified: gnunet/src/include/gnunet_testbed_service.h
===================================================================
--- gnunet/src/include/gnunet_testbed_service.h 2013-04-10 13:29:13 UTC (rev 
26838)
+++ gnunet/src/include/gnunet_testbed_service.h 2013-04-10 14:25:55 UTC (rev 
26839)
@@ -447,7 +447,10 @@
  * @param cfg template configuration to use for the remote controller; the
  *          remote controller will be started with a slightly modified
  *          configuration (port numbers, unix domain sockets and service home
- *          values are changed as per TESTING library on the remote host)
+ *          values are changed as per TESTING library on the remote host).  The
+ *          modified configuration replaces the host's existing configuration
+ *          before signalling success through the
+ *          GNUNET_TESTBED_ControllerStatusCallback()
  * @param cb function called when the controller is successfully started or
  *          dies unexpectedly; GNUNET_TESTBED_controller_stop shouldn't be
  *          called if cb is called with GNUNET_SYSERR as status. Will never be
@@ -478,10 +481,10 @@
 
 
 /**
- * Connect to a controller process using the given configuration at the
- * given host.
+ * Connect to a controller process.  The configuration to use for the 
connection
+ * is retreived from the given host where a controller is started using
+ * GNUNET_TESTBED_controller_start().
  *
- * @param cfg configuration to use
  * @param host host to run the controller on; This should be the same host if
  *          the controller was previously started with
  *          GNUNET_TESTBED_controller_start; NULL for localhost
@@ -495,8 +498,7 @@
  * @return handle to the controller
  */
 struct GNUNET_TESTBED_Controller *
-GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle 
*cfg,
-                                   struct GNUNET_TESTBED_Host *host,
+GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host,
                                    uint64_t event_mask,
                                    GNUNET_TESTBED_ControllerCallback cc,
                                    void *cc_cls);

Modified: gnunet/src/regex/gnunet-regex-profiler.c
===================================================================
--- gnunet/src/regex/gnunet-regex-profiler.c    2013-04-10 13:29:13 UTC (rev 
26838)
+++ gnunet/src/regex/gnunet-regex-profiler.c    2013-04-10 14:25:55 UTC (rev 
26839)
@@ -1805,7 +1805,7 @@
   event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT);
   event_mask |= (1LL << GNUNET_TESTBED_ET_DISCONNECT);
   event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED);
-  mc = GNUNET_TESTBED_controller_connect (config, hosts[0], event_mask,
+  mc = GNUNET_TESTBED_controller_connect (hosts[0], event_mask,
                                           &controller_event_cb, NULL);
   if (NULL == mc)
   {

Modified: gnunet/src/testbed/gnunet-service-testbed_links.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed_links.c   2013-04-10 13:29:13 UTC 
(rev 26838)
+++ gnunet/src/testbed/gnunet-service-testbed_links.c   2013-04-10 14:25:55 UTC 
(rev 26839)
@@ -520,7 +520,7 @@
     goto clean_lcc;
   }
   slave->controller =
-      GNUNET_TESTBED_controller_connect (cfg, GST_host_list[slave->host_id],
+      GNUNET_TESTBED_controller_connect (GST_host_list[slave->host_id],
                                          EVENT_MASK, &slave_event_callback,
                                          slave);
   if (NULL != slave->controller)
@@ -644,7 +644,7 @@
     if (1 != msg->is_subordinate)
     {
       slave->controller =
-          GNUNET_TESTBED_controller_connect (cfg, 
GST_host_list[slave->host_id],
+          GNUNET_TESTBED_controller_connect (GST_host_list[slave->host_id],
                                              EVENT_MASK, &slave_event_callback,
                                              slave);
       if (NULL != slave->controller)

Modified: gnunet/src/testbed/test_testbed_api.c
===================================================================
--- gnunet/src/testbed/test_testbed_api.c       2013-04-10 13:29:13 UTC (rev 
26838)
+++ gnunet/src/testbed/test_testbed_api.c       2013-04-10 14:25:55 UTC (rev 
26839)
@@ -423,7 +423,7 @@
   event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT);
   event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED);
   controller =
-      GNUNET_TESTBED_controller_connect (cfg_, host, event_mask, 
&controller_cb,
+      GNUNET_TESTBED_controller_connect (host, event_mask, &controller_cb,
                                          NULL);
   FAIL_TEST (NULL != controller, return);
   neighbour = GNUNET_TESTBED_host_create ("localhost", NULL, cfg, 0);

Modified: gnunet/src/testbed/test_testbed_api_2peers_1controller.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_2peers_1controller.c    2013-04-10 
13:29:13 UTC (rev 26838)
+++ gnunet/src/testbed/test_testbed_api_2peers_1controller.c    2013-04-10 
14:25:55 UTC (rev 26839)
@@ -469,7 +469,7 @@
   event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT);
   event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED);
   controller =
-      GNUNET_TESTBED_controller_connect (cfg_, host, event_mask, 
&controller_cb,
+      GNUNET_TESTBED_controller_connect (host, event_mask, &controller_cb,
                                          NULL);
   FAIL_TEST (NULL != controller);
   neighbour = GNUNET_TESTBED_host_create ("localhost", NULL, cfg, 0);

Modified: gnunet/src/testbed/test_testbed_api_3peers_3controllers.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_3peers_3controllers.c   2013-04-10 
13:29:13 UTC (rev 26838)
+++ gnunet/src/testbed/test_testbed_api_3peers_3controllers.c   2013-04-10 
14:25:55 UTC (rev 26839)
@@ -803,7 +803,7 @@
   {
   case INIT:
     controller1 =
-        GNUNET_TESTBED_controller_connect (config, host, event_mask,
+        GNUNET_TESTBED_controller_connect (host, event_mask,
                                            &controller_cb, NULL);
     if (NULL == controller1)
     {

Modified: gnunet/src/testbed/test_testbed_api_controllerlink.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_controllerlink.c        2013-04-10 
13:29:13 UTC (rev 26838)
+++ gnunet/src/testbed/test_testbed_api_controllerlink.c        2013-04-10 
14:25:55 UTC (rev 26839)
@@ -658,7 +658,7 @@
     event_mask |= (1L << GNUNET_TESTBED_ET_PEER_STOP);
     event_mask |= (1L << GNUNET_TESTBED_ET_CONNECT);
     event_mask |= (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED);
-    mc = GNUNET_TESTBED_controller_connect (config, host, event_mask,
+    mc = GNUNET_TESTBED_controller_connect (host, event_mask,
                                             &controller_cb, NULL);
     FAIL_TEST (NULL != mc);
     result = MASTER_STARTED;

Modified: gnunet/src/testbed/testbed_api.c
===================================================================
--- gnunet/src/testbed/testbed_api.c    2013-04-10 13:29:13 UTC (rev 26838)
+++ gnunet/src/testbed/testbed_api.c    2013-04-10 14:25:55 UTC (rev 26839)
@@ -1346,19 +1346,20 @@
  * @return handle to the controller
  */
 struct GNUNET_TESTBED_Controller *
-GNUNET_TESTBED_controller_connect (const struct GNUNET_CONFIGURATION_Handle
-                                   *cfg, struct GNUNET_TESTBED_Host *host,
+GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host,
                                    uint64_t event_mask,
                                    GNUNET_TESTBED_ControllerCallback cc,
                                    void *cc_cls)
 {
   struct GNUNET_TESTBED_Controller *controller;
   struct GNUNET_TESTBED_InitMessage *msg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
   const char *controller_hostname;
   unsigned long long max_parallel_operations;
   unsigned long long max_parallel_service_connections;
   unsigned long long max_parallel_topology_config_operations;
 
+  GNUNET_assert (NULL != (cfg = GNUNET_TESTBED_host_get_cfg_ (host)));
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_number (cfg, "testbed",
                                              "MAX_PARALLEL_OPERATIONS",

Modified: gnunet/src/testbed/testbed_api_testbed.c
===================================================================
--- gnunet/src/testbed/testbed_api_testbed.c    2013-04-10 13:29:13 UTC (rev 
26838)
+++ gnunet/src/testbed/testbed_api_testbed.c    2013-04-10 14:25:55 UTC (rev 
26839)
@@ -875,8 +875,7 @@
   if (rc->topology < GNUNET_TESTBED_TOPOLOGY_NONE)
     event_mask |= GNUNET_TESTBED_ET_CONNECT;
   rc->c =
-      GNUNET_TESTBED_controller_connect (rc->cfg, rc->h, event_mask, &event_cb,
-                                         rc);
+      GNUNET_TESTBED_controller_connect (rc->h, event_mask, &event_cb, rc);
   if (0 < rc->num_hosts)
   {
     rc->reg_hosts = 0;




reply via email to

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