gnunet-svn
[Top][All Lists]
Advanced

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

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


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

Author: harsha
Date: 2013-04-10 16:41:35 +0200 (Wed, 10 Apr 2013)
New Revision: 26840

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_hosts.c
   gnunet/src/testbed/testbed_api_testbed.c
Log:
- use host's configuration while starting controller on the host


Modified: gnunet/src/include/gnunet_testbed_service.h
===================================================================
--- gnunet/src/include/gnunet_testbed_service.h 2013-04-10 14:25:55 UTC (rev 
26839)
+++ gnunet/src/include/gnunet_testbed_service.h 2013-04-10 14:41:35 UTC (rev 
26840)
@@ -436,21 +436,19 @@
 
 
 /**
- * Starts a controller process at the given host.
+ * Starts a controller process at the given host.  The given host's 
configration
+ * is used as a 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).  The modified configuration replaces 
the
+ * host's existing configuration before signalling success through the
+ * GNUNET_TESTBED_ControllerStatusCallback()
  *
  * @param trusted_ip the ip address of the controller which will be set as 
TRUSTED
  *          HOST(all connections form this ip are permitted by the testbed) 
when
  *          starting testbed controller at host. This can either be a single ip
  *          address or a network address in CIDR notation.
- * @param host the host where the controller has to be started; NULL for
- *          localhost
- * @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).  The
- *          modified configuration replaces the host's existing configuration
- *          before signalling success through the
- *          GNUNET_TESTBED_ControllerStatusCallback()
+ * @param host the host where the controller has to be started.  CANNOT be 
NULL.
  * @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
@@ -463,7 +461,6 @@
 struct GNUNET_TESTBED_ControllerProc *
 GNUNET_TESTBED_controller_start (const char *trusted_ip,
                                  struct GNUNET_TESTBED_Host *host,
-                                 const struct GNUNET_CONFIGURATION_Handle *cfg,
                                  GNUNET_TESTBED_ControllerStatusCallback cb,
                                  void *cls);
 

Modified: gnunet/src/regex/gnunet-regex-profiler.c
===================================================================
--- gnunet/src/regex/gnunet-regex-profiler.c    2013-04-10 14:25:55 UTC (rev 
26839)
+++ gnunet/src/regex/gnunet-regex-profiler.c    2013-04-10 14:41:35 UTC (rev 
26840)
@@ -1932,7 +1932,6 @@
       GNUNET_TESTBED_controller_start (GNUNET_TESTBED_host_get_hostname
                                        (hosts[0]),
                                        hosts[0],
-                                       cfg,
                                        status_cb,
                                        NULL);
 }

Modified: gnunet/src/testbed/gnunet-service-testbed_links.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed_links.c   2013-04-10 14:25:55 UTC 
(rev 26839)
+++ gnunet/src/testbed/gnunet-service-testbed_links.c   2013-04-10 14:41:35 UTC 
(rev 26840)
@@ -667,7 +667,7 @@
     slave->lcc = lcc;
     slave->controller_proc =
         GNUNET_TESTBED_controller_start (GST_context->master_ip,
-                                         GST_host_list[slave->host_id], cfg,
+                                         GST_host_list[slave->host_id],
                                          &slave_status_callback, slave);
     GNUNET_CONFIGURATION_destroy (cfg);
     new_route = GNUNET_malloc (sizeof (struct Route));

Modified: gnunet/src/testbed/test_testbed_api.c
===================================================================
--- gnunet/src/testbed/test_testbed_api.c       2013-04-10 14:25:55 UTC (rev 
26839)
+++ gnunet/src/testbed/test_testbed_api.c       2013-04-10 14:41:35 UTC (rev 
26840)
@@ -451,7 +451,7 @@
   cfg = GNUNET_CONFIGURATION_dup (config);
   host = GNUNET_TESTBED_host_create (NULL, NULL, cfg, 0);
   FAIL_TEST (NULL != host, return);
-  cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb,
+  cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, status_cb,
                                         NULL);
   abort_task =
       GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply

Modified: gnunet/src/testbed/test_testbed_api_2peers_1controller.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_2peers_1controller.c    2013-04-10 
14:25:55 UTC (rev 26839)
+++ gnunet/src/testbed/test_testbed_api_2peers_1controller.c    2013-04-10 
14:41:35 UTC (rev 26840)
@@ -497,7 +497,7 @@
   cfg = GNUNET_CONFIGURATION_dup (config);
   host = GNUNET_TESTBED_host_create (NULL, NULL, cfg, 0);
   FAIL_TEST (NULL != host);
-  cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb,
+  cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, status_cb,
                                         NULL);
   abort_task =
       GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply

Modified: gnunet/src/testbed/test_testbed_api_3peers_3controllers.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_3peers_3controllers.c   2013-04-10 
14:25:55 UTC (rev 26839)
+++ gnunet/src/testbed/test_testbed_api_3peers_3controllers.c   2013-04-10 
14:41:35 UTC (rev 26840)
@@ -865,7 +865,7 @@
     return;
   }
   cp1 =
-      GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb, 
NULL);
+      GNUNET_TESTBED_controller_start ("127.0.0.1", host, status_cb, NULL);
 }
 
 

Modified: gnunet/src/testbed/test_testbed_api_controllerlink.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_controllerlink.c        2013-04-10 
14:25:55 UTC (rev 26839)
+++ gnunet/src/testbed/test_testbed_api_controllerlink.c        2013-04-10 
14:41:35 UTC (rev 26840)
@@ -700,7 +700,7 @@
     result = SKIP;
     return;
   }
-  cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb,
+  cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, status_cb,
                                         NULL);
 }
 

Modified: gnunet/src/testbed/testbed_api.c
===================================================================
--- gnunet/src/testbed/testbed_api.c    2013-04-10 14:25:55 UTC (rev 26839)
+++ gnunet/src/testbed/testbed_api.c    2013-04-10 14:41:35 UTC (rev 26840)
@@ -1762,7 +1762,6 @@
 {
   uint32_t slave_host_id;
   uint32_t delegated_host_id;
-
   
   GNUNET_assert (GNUNET_YES ==
                  GNUNET_TESTBED_is_host_registered_ (delegated_host, master));

Modified: gnunet/src/testbed/testbed_api_hosts.c
===================================================================
--- gnunet/src/testbed/testbed_api_hosts.c      2013-04-10 14:25:55 UTC (rev 
26839)
+++ gnunet/src/testbed/testbed_api_hosts.c      2013-04-10 14:41:35 UTC (rev 
26840)
@@ -1131,18 +1131,19 @@
 
 
 /**
- * Starts a controller process at the given host
+ * Starts a controller process at the given host.  The given host's 
configration
+ * is used as a 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).  The modified configuration replaces 
the
+ * host's existing configuration before signalling success through the
+ * GNUNET_TESTBED_ControllerStatusCallback()
  *
  * @param trusted_ip the ip address of the controller which will be set as 
TRUSTED
  *          HOST(all connections form this ip are permitted by the testbed) 
when
  *          starting testbed controller at host. This can either be a single ip
  *          address or a network address in CIDR notation.
- * @param host the host where the controller has to be started; NULL for
- *          localhost
- * @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)
+ * @param host the host where the controller has to be started.  CANNOT be 
NULL.
  * @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
@@ -1155,18 +1156,19 @@
 struct GNUNET_TESTBED_ControllerProc *
 GNUNET_TESTBED_controller_start (const char *trusted_ip,
                                  struct GNUNET_TESTBED_Host *host,
-                                 const struct GNUNET_CONFIGURATION_Handle *cfg,
                                  GNUNET_TESTBED_ControllerStatusCallback cb,
                                  void *cls)
 {
   struct GNUNET_TESTBED_ControllerProc *cp;
   struct GNUNET_TESTBED_HelperInit *msg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
   const char *hostname;
-
   static char *const binary_argv[] = {
     HELPER_TESTBED_BINARY, NULL
   };
-
+  
+  GNUNET_assert (NULL != host);
+  GNUNET_assert (NULL != (cfg = GNUNET_TESTBED_host_get_cfg_ (host)));
   hostname = NULL;
   API_VIOLATION (GNUNET_NO == host->locked,
                  "Host is already locked by a previous call to 
GNUNET_TESTBED_controller_start()");
@@ -1174,7 +1176,7 @@
   API_VIOLATION (GNUNET_NO == host->controller_started,
                  "Attempting to start a controller on a host which is already 
started a controller");
   cp = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ControllerProc));
-  if ((NULL == host) || (0 == GNUNET_TESTBED_host_get_id_ (host)))
+  if (0 == GNUNET_TESTBED_host_get_id_ (host))
   {
     cp->helper =
         GNUNET_HELPER_start (GNUNET_YES, HELPER_TESTBED_BINARY, binary_argv,

Modified: gnunet/src/testbed/testbed_api_testbed.c
===================================================================
--- gnunet/src/testbed/testbed_api_testbed.c    2013-04-10 14:25:55 UTC (rev 
26839)
+++ gnunet/src/testbed/testbed_api_testbed.c    2013-04-10 14:41:35 UTC (rev 
26840)
@@ -986,7 +986,7 @@
   if (NULL == rc->trusted_ip)
     rc->trusted_ip = GNUNET_strdup ("127.0.0.1");
   rc->cproc =
-      GNUNET_TESTBED_controller_start (rc->trusted_ip, rc->h, rc->cfg,
+      GNUNET_TESTBED_controller_start (rc->trusted_ip, rc->h,
                                        &controller_status_cb, rc);
   GNUNET_free (rc->trusted_ip);
   rc->trusted_ip = NULL;
@@ -1175,7 +1175,7 @@
   }
   else
     rc->cproc =
-        GNUNET_TESTBED_controller_start ("127.0.0.1", rc->h, rc->cfg,
+        GNUNET_TESTBED_controller_start ("127.0.0.1", rc->h,
                                          &controller_status_cb, rc);
   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg, "TESTBED",
                                                         "SETUP_TIMEOUT",




reply via email to

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