From d7a4acf7971533111c19ec56b2e145d200ca1cae Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Mon, 13 May 2013 14:29:54 +0000 Subject: - allow reading hostnames with dashes/hyphens --- src/testbed/sample_hosts.txt | 2 ++ src/testbed/test_testbed_api_hosts.c | 4 ++-- src/testbed/testbed_api_hosts.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/testbed/sample_hosts.txt b/src/testbed/sample_hosts.txt index 5b661696b..d0ce5cb45 100644 --- a/src/testbed/sample_hosts.txt +++ b/src/testbed/sample_hosts.txt @@ -13,3 +13,5 @@ totakura@192.168.0.12:22 totakura@192.168.0.13:22 totakura@192.168.0.14:22 totakura@192.168.0.15:22 +totakura@opt01:22 +totakura@i19-n015:22 diff --git a/src/testbed/test_testbed_api_hosts.c b/src/testbed/test_testbed_api_hosts.c index bf72a326c..17ccc7050 100644 --- a/src/testbed/test_testbed_api_hosts.c +++ b/src/testbed/test_testbed_api_hosts.c @@ -110,11 +110,11 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_assert (host == GNUNET_TESTBED_host_lookup_by_id_ (0)); hosts = NULL; num_hosts = GNUNET_TESTBED_hosts_load_from_file ("sample_hosts.txt", cfg, &hosts); - GNUNET_assert (15 == num_hosts); + GNUNET_assert (17 == num_hosts); GNUNET_assert (NULL != hosts); status = GNUNET_YES; shutdown_id = - GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS (2), &do_shutdown, NULL); + GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS (0), &do_shutdown, NULL); } diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index e76dada88..374fee8ef 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c @@ -486,7 +486,7 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, { data[offset] = '\0'; ret = - SSCANF (buf, "%255[a-zA-Z0-9_]@%255[a-zA-Z0-9.]:%5hd", username, + SSCANF (buf, "%255[a-zA-Z0-9_]@%255[a-zA-Z0-9.-]:%5hd", username, hostname, &port); if (3 == ret) { -- cgit v1.2.3