aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/test_testbed_api_controllerlink.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-02-20 15:15:35 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-02-20 15:15:35 +0000
commita807aa20caec761b314a5eddcffbdd36650bd7d9 (patch)
treee68bc0be91a5db17740d71fa74ea132c7f3d13bc /src/testbed/test_testbed_api_controllerlink.c
parentadf18305521dc87c4ca1aee82e910ff8e22199cc (diff)
downloadgnunet-a807aa20caec761b314a5eddcffbdd36650bd7d9.tar.gz
gnunet-a807aa20caec761b314a5eddcffbdd36650bd7d9.zip
Assosiate a configuration template while creating hosts. This paves a way to
manage the configurations of controllers running on a host automatically. modified ADD_HOST message structure to have host configuration. This feature is yet to be implemented. The idea is that GNUNET_TESTBED_link_controllers() should take no configuration when hosts automatically update configuration when a new configuration is generated from a template.
Diffstat (limited to 'src/testbed/test_testbed_api_controllerlink.c')
-rw-r--r--src/testbed/test_testbed_api_controllerlink.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c
index f0ce4daa5..c10451703 100644
--- a/src/testbed/test_testbed_api_controllerlink.c
+++ b/src/testbed/test_testbed_api_controllerlink.c
@@ -484,7 +484,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
484 FAIL_TEST (event->details.peer_start.peer == master_peer); 484 FAIL_TEST (event->details.peer_start.peer == master_peer);
485 GNUNET_TESTBED_operation_done (op); 485 GNUNET_TESTBED_operation_done (op);
486 result = MASTER_PEER_START_SUCCESS; 486 result = MASTER_PEER_START_SUCCESS;
487 slave = GNUNET_TESTBED_host_create_with_id (1, "127.0.0.1", NULL, 0); 487 slave = GNUNET_TESTBED_host_create_with_id (1, "127.0.0.1", NULL, cfg, 0);
488 FAIL_TEST (NULL != slave); 488 FAIL_TEST (NULL != slave);
489 rh = GNUNET_TESTBED_register_host (mc, slave, &registration_cont, NULL); 489 rh = GNUNET_TESTBED_register_host (mc, slave, &registration_cont, NULL);
490 FAIL_TEST (NULL != rh); 490 FAIL_TEST (NULL != rh);
@@ -548,7 +548,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
548 GNUNET_TESTBED_operation_done (op); 548 GNUNET_TESTBED_operation_done (op);
549 op = NULL; 549 op = NULL;
550 result = SLAVE2_PEER_DESTROY_SUCCESS; 550 result = SLAVE2_PEER_DESTROY_SUCCESS;
551 slave3 = GNUNET_TESTBED_host_create_with_id (3, "127.0.0.1", NULL, 0); 551 slave3 = GNUNET_TESTBED_host_create_with_id (3, "127.0.0.1", NULL, cfg, 0);
552 rh = GNUNET_TESTBED_register_host (mc, slave3, &registration_cont, NULL); 552 rh = GNUNET_TESTBED_register_host (mc, slave3, &registration_cont, NULL);
553 break; 553 break;
554 case SLAVE3_REGISTERED: 554 case SLAVE3_REGISTERED:
@@ -607,7 +607,7 @@ registration_cont (void *cls, const char *emsg)
607 FAIL_TEST (NULL == emsg); 607 FAIL_TEST (NULL == emsg);
608 FAIL_TEST (NULL != mc); 608 FAIL_TEST (NULL != mc);
609 result = SLAVE1_REGISTERED; 609 result = SLAVE1_REGISTERED;
610 slave2 = GNUNET_TESTBED_host_create_with_id (2, "127.0.0.1", NULL, 0); 610 slave2 = GNUNET_TESTBED_host_create_with_id (2, "127.0.0.1", NULL, cfg, 0);
611 FAIL_TEST (NULL != slave2); 611 FAIL_TEST (NULL != slave2);
612 rh = GNUNET_TESTBED_register_host (mc, slave2, &registration_cont, NULL); 612 rh = GNUNET_TESTBED_register_host (mc, slave2, &registration_cont, NULL);
613 FAIL_TEST (NULL != rh); 613 FAIL_TEST (NULL != rh);
@@ -717,7 +717,8 @@ static void
717run (void *cls, char *const *args, const char *cfgfile, 717run (void *cls, char *const *args, const char *cfgfile,
718 const struct GNUNET_CONFIGURATION_Handle *config) 718 const struct GNUNET_CONFIGURATION_Handle *config)
719{ 719{
720 host = GNUNET_TESTBED_host_create (NULL, NULL, 0); 720 cfg = GNUNET_CONFIGURATION_dup (config);
721 host = GNUNET_TESTBED_host_create (NULL, NULL, cfg, 0);
721 FAIL_TEST (NULL != host); 722 FAIL_TEST (NULL != host);
722 if (NULL == 723 if (NULL ==
723 (hc_handle = 724 (hc_handle =
@@ -725,6 +726,8 @@ run (void *cls, char *const *args, const char *cfgfile,
725 NULL))) 726 NULL)))
726 { 727 {
727 GNUNET_TESTBED_host_destroy (host); 728 GNUNET_TESTBED_host_destroy (host);
729 GNUNET_CONFIGURATION_destroy (cfg);
730 cfg = NULL;
728 host = NULL; 731 host = NULL;
729 (void) PRINTF ("%s", 732 (void) PRINTF ("%s",
730 "Unable to run the test as this system is not configured " 733 "Unable to run the test as this system is not configured "
@@ -733,7 +736,6 @@ run (void *cls, char *const *args, const char *cfgfile,
733 result = SKIP; 736 result = SKIP;
734 return; 737 return;
735 } 738 }
736 cfg = GNUNET_CONFIGURATION_dup (config);
737 abort_task = 739 abort_task =
738 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 740 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
739 (GNUNET_TIME_UNIT_MINUTES, 5), &do_abort, 741 (GNUNET_TIME_UNIT_MINUTES, 5), &do_abort,