- use host's configuration while connecting to controller
authorSree Harsha Totakura <totakura@in.tum.de>
Wed, 10 Apr 2013 14:25:55 +0000 (14:25 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Wed, 10 Apr 2013 14:25:55 +0000 (14:25 +0000)
src/include/gnunet_testbed_service.h
src/regex/gnunet-regex-profiler.c
src/testbed/gnunet-service-testbed_links.c
src/testbed/test_testbed_api.c
src/testbed/test_testbed_api_2peers_1controller.c
src/testbed/test_testbed_api_3peers_3controllers.c
src/testbed/test_testbed_api_controllerlink.c
src/testbed/testbed_api.c
src/testbed/testbed_api_testbed.c

index 522484821e1d7512a7d4ef60743235c3afde70fd..61b347e78149185532c0f2675bd679e62fe4d14a 100644 (file)
@@ -447,7 +447,10 @@ typedef void (*GNUNET_TESTBED_ControllerStatusCallback) (void *cls,
  * @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 @@ GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc);
 
 
 /**
- * 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 @@ GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc);
  * @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);
index 25fb4b6a34125f76e64ad20ae70e88819f749398..b532094579bc3b09850a8c8cbc2444a194d71cea 100644 (file)
@@ -1805,7 +1805,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config, int stat
   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)
   {
index 6f71d8a611ee7c0a5a3d2daa7f864f9c8d74966b..0e2a88c40790c00a49e9b2ee0d91181e7a76c30c 100644 (file)
@@ -520,7 +520,7 @@ slave_status_callback (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg,
     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 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client,
     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)
index 2e18f3411984cd51f9d6c8e48a1d4056cfe006c3..e579536c009606478177aadb6353cdd7eefbc87b 100644 (file)
@@ -423,7 +423,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg_, int status
   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);
index 4907be74660ad94fd035a7799f56c844f90a8e71..5f7bd3de74f32350566a4bc5c5a8cde2a6dd6d2c 100644 (file)
@@ -469,7 +469,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg_, int status
   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);
index 0a416145e06a30c3bae4f5a4ceff2ccd770a76cc..48e60f108326991406be7d156bda173a4bc11432 100644 (file)
@@ -803,7 +803,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config,
   {
   case INIT:
     controller1 =
-        GNUNET_TESTBED_controller_connect (config, host, event_mask,
+        GNUNET_TESTBED_controller_connect (host, event_mask,
                                            &controller_cb, NULL);
     if (NULL == controller1)
     {
index 4831277952fe0d9c28e9b72f00b4276d342b3863..7475cd0e2373f49676e4e29ff905e1616d8e4d90 100644 (file)
@@ -658,7 +658,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config,
     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;
index 95ff9e4325cf40229c4f4a1e81790f62efffd8c4..faaa739ccb694a69443bb6cd140a7a1aa5f77c38 100644 (file)
@@ -1346,19 +1346,20 @@ oprelease_get_slave_config (void *cls)
  * @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",
index 280b4d80397066c949a3e81626ca311e0c55b23c..57d57050a144aca61076e5c331230468e5d21434 100644 (file)
@@ -875,8 +875,7 @@ controller_status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg,
   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;