diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-04-10 14:41:35 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-04-10 14:41:35 +0000 |
commit | 77e2b5831b45e6a22c5218cbcfb46175c3411a66 (patch) | |
tree | eb6b14d4dcc43cc7fbe6f5a116a8d1a5d4e81da4 | |
parent | f4446e40904ba3f3177a8eaf1f9756e48dcc03a9 (diff) | |
download | gnunet-77e2b5831b45e6a22c5218cbcfb46175c3411a66.tar.gz gnunet-77e2b5831b45e6a22c5218cbcfb46175c3411a66.zip |
- use host's configuration while starting controller on the host
-rw-r--r-- | src/include/gnunet_testbed_service.h | 19 | ||||
-rw-r--r-- | src/regex/gnunet-regex-profiler.c | 1 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_links.c | 2 | ||||
-rw-r--r-- | src/testbed/test_testbed_api.c | 2 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_2peers_1controller.c | 2 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_3peers_3controllers.c | 2 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_controllerlink.c | 2 | ||||
-rw-r--r-- | src/testbed/testbed_api.c | 1 | ||||
-rw-r--r-- | src/testbed/testbed_api_hosts.c | 24 | ||||
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 4 |
10 files changed, 28 insertions, 31 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index 61b347e78..86e3cd194 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -436,21 +436,19 @@ typedef void (*GNUNET_TESTBED_ControllerStatusCallback) (void *cls, | |||
436 | 436 | ||
437 | 437 | ||
438 | /** | 438 | /** |
439 | * Starts a controller process at the given host. | 439 | * Starts a controller process at the given host. The given host's configration |
440 | * is used as a Template configuration to use for the remote controller; the | ||
441 | * remote controller will be started with a slightly modified configuration | ||
442 | * (port numbers, unix domain sockets and service home values are changed as per | ||
443 | * TESTING library on the remote host). The modified configuration replaces the | ||
444 | * host's existing configuration before signalling success through the | ||
445 | * GNUNET_TESTBED_ControllerStatusCallback() | ||
440 | * | 446 | * |
441 | * @param trusted_ip the ip address of the controller which will be set as TRUSTED | 447 | * @param trusted_ip the ip address of the controller which will be set as TRUSTED |
442 | * HOST(all connections form this ip are permitted by the testbed) when | 448 | * HOST(all connections form this ip are permitted by the testbed) when |
443 | * starting testbed controller at host. This can either be a single ip | 449 | * starting testbed controller at host. This can either be a single ip |
444 | * address or a network address in CIDR notation. | 450 | * address or a network address in CIDR notation. |
445 | * @param host the host where the controller has to be started; NULL for | 451 | * @param host the host where the controller has to be started. CANNOT be NULL. |
446 | * localhost | ||
447 | * @param cfg template configuration to use for the remote controller; the | ||
448 | * remote controller will be started with a slightly modified | ||
449 | * configuration (port numbers, unix domain sockets and service home | ||
450 | * values are changed as per TESTING library on the remote host). The | ||
451 | * modified configuration replaces the host's existing configuration | ||
452 | * before signalling success through the | ||
453 | * GNUNET_TESTBED_ControllerStatusCallback() | ||
454 | * @param cb function called when the controller is successfully started or | 452 | * @param cb function called when the controller is successfully started or |
455 | * dies unexpectedly; GNUNET_TESTBED_controller_stop shouldn't be | 453 | * dies unexpectedly; GNUNET_TESTBED_controller_stop shouldn't be |
456 | * called if cb is called with GNUNET_SYSERR as status. Will never be | 454 | * called if cb is called with GNUNET_SYSERR as status. Will never be |
@@ -463,7 +461,6 @@ typedef void (*GNUNET_TESTBED_ControllerStatusCallback) (void *cls, | |||
463 | struct GNUNET_TESTBED_ControllerProc * | 461 | struct GNUNET_TESTBED_ControllerProc * |
464 | GNUNET_TESTBED_controller_start (const char *trusted_ip, | 462 | GNUNET_TESTBED_controller_start (const char *trusted_ip, |
465 | struct GNUNET_TESTBED_Host *host, | 463 | struct GNUNET_TESTBED_Host *host, |
466 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
467 | GNUNET_TESTBED_ControllerStatusCallback cb, | 464 | GNUNET_TESTBED_ControllerStatusCallback cb, |
468 | void *cls); | 465 | void *cls); |
469 | 466 | ||
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c index b53209457..2fe248f1e 100644 --- a/src/regex/gnunet-regex-profiler.c +++ b/src/regex/gnunet-regex-profiler.c | |||
@@ -1932,7 +1932,6 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host, int status | |||
1932 | GNUNET_TESTBED_controller_start (GNUNET_TESTBED_host_get_hostname | 1932 | GNUNET_TESTBED_controller_start (GNUNET_TESTBED_host_get_hostname |
1933 | (hosts[0]), | 1933 | (hosts[0]), |
1934 | hosts[0], | 1934 | hosts[0], |
1935 | cfg, | ||
1936 | status_cb, | 1935 | status_cb, |
1937 | NULL); | 1936 | NULL); |
1938 | } | 1937 | } |
diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c index 0e2a88c40..d09e4aff6 100644 --- a/src/testbed/gnunet-service-testbed_links.c +++ b/src/testbed/gnunet-service-testbed_links.c | |||
@@ -667,7 +667,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
667 | slave->lcc = lcc; | 667 | slave->lcc = lcc; |
668 | slave->controller_proc = | 668 | slave->controller_proc = |
669 | GNUNET_TESTBED_controller_start (GST_context->master_ip, | 669 | GNUNET_TESTBED_controller_start (GST_context->master_ip, |
670 | GST_host_list[slave->host_id], cfg, | 670 | GST_host_list[slave->host_id], |
671 | &slave_status_callback, slave); | 671 | &slave_status_callback, slave); |
672 | GNUNET_CONFIGURATION_destroy (cfg); | 672 | GNUNET_CONFIGURATION_destroy (cfg); |
673 | new_route = GNUNET_malloc (sizeof (struct Route)); | 673 | new_route = GNUNET_malloc (sizeof (struct Route)); |
diff --git a/src/testbed/test_testbed_api.c b/src/testbed/test_testbed_api.c index e579536c0..a82f48854 100644 --- a/src/testbed/test_testbed_api.c +++ b/src/testbed/test_testbed_api.c | |||
@@ -451,7 +451,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
451 | cfg = GNUNET_CONFIGURATION_dup (config); | 451 | cfg = GNUNET_CONFIGURATION_dup (config); |
452 | host = GNUNET_TESTBED_host_create (NULL, NULL, cfg, 0); | 452 | host = GNUNET_TESTBED_host_create (NULL, NULL, cfg, 0); |
453 | FAIL_TEST (NULL != host, return); | 453 | FAIL_TEST (NULL != host, return); |
454 | cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb, | 454 | cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, status_cb, |
455 | NULL); | 455 | NULL); |
456 | abort_task = | 456 | abort_task = |
457 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 457 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
diff --git a/src/testbed/test_testbed_api_2peers_1controller.c b/src/testbed/test_testbed_api_2peers_1controller.c index 5f7bd3de7..18bff91e9 100644 --- a/src/testbed/test_testbed_api_2peers_1controller.c +++ b/src/testbed/test_testbed_api_2peers_1controller.c | |||
@@ -497,7 +497,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
497 | cfg = GNUNET_CONFIGURATION_dup (config); | 497 | cfg = GNUNET_CONFIGURATION_dup (config); |
498 | host = GNUNET_TESTBED_host_create (NULL, NULL, cfg, 0); | 498 | host = GNUNET_TESTBED_host_create (NULL, NULL, cfg, 0); |
499 | FAIL_TEST (NULL != host); | 499 | FAIL_TEST (NULL != host); |
500 | cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb, | 500 | cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, status_cb, |
501 | NULL); | 501 | NULL); |
502 | abort_task = | 502 | abort_task = |
503 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 503 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
diff --git a/src/testbed/test_testbed_api_3peers_3controllers.c b/src/testbed/test_testbed_api_3peers_3controllers.c index 48e60f108..752d7e872 100644 --- a/src/testbed/test_testbed_api_3peers_3controllers.c +++ b/src/testbed/test_testbed_api_3peers_3controllers.c | |||
@@ -865,7 +865,7 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *_host, | |||
865 | return; | 865 | return; |
866 | } | 866 | } |
867 | cp1 = | 867 | cp1 = |
868 | GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb, NULL); | 868 | GNUNET_TESTBED_controller_start ("127.0.0.1", host, status_cb, NULL); |
869 | } | 869 | } |
870 | 870 | ||
871 | 871 | ||
diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c index 7475cd0e2..b640dea4c 100644 --- a/src/testbed/test_testbed_api_controllerlink.c +++ b/src/testbed/test_testbed_api_controllerlink.c | |||
@@ -700,7 +700,7 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *_host, | |||
700 | result = SKIP; | 700 | result = SKIP; |
701 | return; | 701 | return; |
702 | } | 702 | } |
703 | cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, cfg, status_cb, | 703 | cp = GNUNET_TESTBED_controller_start ("127.0.0.1", host, status_cb, |
704 | NULL); | 704 | NULL); |
705 | } | 705 | } |
706 | 706 | ||
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index faaa739cc..564637caa 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -1762,7 +1762,6 @@ GNUNET_TESTBED_controller_link (void *op_cls, | |||
1762 | { | 1762 | { |
1763 | uint32_t slave_host_id; | 1763 | uint32_t slave_host_id; |
1764 | uint32_t delegated_host_id; | 1764 | uint32_t delegated_host_id; |
1765 | |||
1766 | 1765 | ||
1767 | GNUNET_assert (GNUNET_YES == | 1766 | GNUNET_assert (GNUNET_YES == |
1768 | GNUNET_TESTBED_is_host_registered_ (delegated_host, master)); | 1767 | GNUNET_TESTBED_is_host_registered_ (delegated_host, master)); |
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index 9153202dc..e5b6d0a0b 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c | |||
@@ -1131,18 +1131,19 @@ helper_exp_cb (void *cls) | |||
1131 | 1131 | ||
1132 | 1132 | ||
1133 | /** | 1133 | /** |
1134 | * Starts a controller process at the given host | 1134 | * Starts a controller process at the given host. The given host's configration |
1135 | * is used as a Template configuration to use for the remote controller; the | ||
1136 | * remote controller will be started with a slightly modified configuration | ||
1137 | * (port numbers, unix domain sockets and service home values are changed as per | ||
1138 | * TESTING library on the remote host). The modified configuration replaces the | ||
1139 | * host's existing configuration before signalling success through the | ||
1140 | * GNUNET_TESTBED_ControllerStatusCallback() | ||
1135 | * | 1141 | * |
1136 | * @param trusted_ip the ip address of the controller which will be set as TRUSTED | 1142 | * @param trusted_ip the ip address of the controller which will be set as TRUSTED |
1137 | * HOST(all connections form this ip are permitted by the testbed) when | 1143 | * HOST(all connections form this ip are permitted by the testbed) when |
1138 | * starting testbed controller at host. This can either be a single ip | 1144 | * starting testbed controller at host. This can either be a single ip |
1139 | * address or a network address in CIDR notation. | 1145 | * address or a network address in CIDR notation. |
1140 | * @param host the host where the controller has to be started; NULL for | 1146 | * @param host the host where the controller has to be started. CANNOT be NULL. |
1141 | * localhost | ||
1142 | * @param cfg template configuration to use for the remote controller; the | ||
1143 | * remote controller will be started with a slightly modified | ||
1144 | * configuration (port numbers, unix domain sockets and service home | ||
1145 | * values are changed as per TESTING library on the remote host) | ||
1146 | * @param cb function called when the controller is successfully started or | 1147 | * @param cb function called when the controller is successfully started or |
1147 | * dies unexpectedly; GNUNET_TESTBED_controller_stop shouldn't be | 1148 | * dies unexpectedly; GNUNET_TESTBED_controller_stop shouldn't be |
1148 | * called if cb is called with GNUNET_SYSERR as status. Will never be | 1149 | * called if cb is called with GNUNET_SYSERR as status. Will never be |
@@ -1155,18 +1156,19 @@ helper_exp_cb (void *cls) | |||
1155 | struct GNUNET_TESTBED_ControllerProc * | 1156 | struct GNUNET_TESTBED_ControllerProc * |
1156 | GNUNET_TESTBED_controller_start (const char *trusted_ip, | 1157 | GNUNET_TESTBED_controller_start (const char *trusted_ip, |
1157 | struct GNUNET_TESTBED_Host *host, | 1158 | struct GNUNET_TESTBED_Host *host, |
1158 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
1159 | GNUNET_TESTBED_ControllerStatusCallback cb, | 1159 | GNUNET_TESTBED_ControllerStatusCallback cb, |
1160 | void *cls) | 1160 | void *cls) |
1161 | { | 1161 | { |
1162 | struct GNUNET_TESTBED_ControllerProc *cp; | 1162 | struct GNUNET_TESTBED_ControllerProc *cp; |
1163 | struct GNUNET_TESTBED_HelperInit *msg; | 1163 | struct GNUNET_TESTBED_HelperInit *msg; |
1164 | const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
1164 | const char *hostname; | 1165 | const char *hostname; |
1165 | |||
1166 | static char *const binary_argv[] = { | 1166 | static char *const binary_argv[] = { |
1167 | HELPER_TESTBED_BINARY, NULL | 1167 | HELPER_TESTBED_BINARY, NULL |
1168 | }; | 1168 | }; |
1169 | 1169 | ||
1170 | GNUNET_assert (NULL != host); | ||
1171 | GNUNET_assert (NULL != (cfg = GNUNET_TESTBED_host_get_cfg_ (host))); | ||
1170 | hostname = NULL; | 1172 | hostname = NULL; |
1171 | API_VIOLATION (GNUNET_NO == host->locked, | 1173 | API_VIOLATION (GNUNET_NO == host->locked, |
1172 | "Host is already locked by a previous call to GNUNET_TESTBED_controller_start()"); | 1174 | "Host is already locked by a previous call to GNUNET_TESTBED_controller_start()"); |
@@ -1174,7 +1176,7 @@ GNUNET_TESTBED_controller_start (const char *trusted_ip, | |||
1174 | API_VIOLATION (GNUNET_NO == host->controller_started, | 1176 | API_VIOLATION (GNUNET_NO == host->controller_started, |
1175 | "Attempting to start a controller on a host which is already started a controller"); | 1177 | "Attempting to start a controller on a host which is already started a controller"); |
1176 | cp = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ControllerProc)); | 1178 | cp = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ControllerProc)); |
1177 | if ((NULL == host) || (0 == GNUNET_TESTBED_host_get_id_ (host))) | 1179 | if (0 == GNUNET_TESTBED_host_get_id_ (host)) |
1178 | { | 1180 | { |
1179 | cp->helper = | 1181 | cp->helper = |
1180 | GNUNET_HELPER_start (GNUNET_YES, HELPER_TESTBED_BINARY, binary_argv, | 1182 | GNUNET_HELPER_start (GNUNET_YES, HELPER_TESTBED_BINARY, binary_argv, |
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 57d57050a..a7134d24e 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -986,7 +986,7 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host, | |||
986 | if (NULL == rc->trusted_ip) | 986 | if (NULL == rc->trusted_ip) |
987 | rc->trusted_ip = GNUNET_strdup ("127.0.0.1"); | 987 | rc->trusted_ip = GNUNET_strdup ("127.0.0.1"); |
988 | rc->cproc = | 988 | rc->cproc = |
989 | GNUNET_TESTBED_controller_start (rc->trusted_ip, rc->h, rc->cfg, | 989 | GNUNET_TESTBED_controller_start (rc->trusted_ip, rc->h, |
990 | &controller_status_cb, rc); | 990 | &controller_status_cb, rc); |
991 | GNUNET_free (rc->trusted_ip); | 991 | GNUNET_free (rc->trusted_ip); |
992 | rc->trusted_ip = NULL; | 992 | rc->trusted_ip = NULL; |
@@ -1175,7 +1175,7 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1175 | } | 1175 | } |
1176 | else | 1176 | else |
1177 | rc->cproc = | 1177 | rc->cproc = |
1178 | GNUNET_TESTBED_controller_start ("127.0.0.1", rc->h, rc->cfg, | 1178 | GNUNET_TESTBED_controller_start ("127.0.0.1", rc->h, |
1179 | &controller_status_cb, rc); | 1179 | &controller_status_cb, rc); |
1180 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg, "TESTBED", | 1180 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg, "TESTBED", |
1181 | "SETUP_TIMEOUT", | 1181 | "SETUP_TIMEOUT", |