From e8bc36209dd09c9720c6ea8657e4f49c35c08956 Mon Sep 17 00:00:00 2001 From: "Nathan S. Evans" Date: Tue, 26 Jul 2011 10:33:53 +0000 Subject: [PATCH] fixes for remote peer testing --- src/testing/testing_group.c | 47 ++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index e928a2e79..5b5981707 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c @@ -1453,10 +1453,14 @@ make_config(const struct GNUNET_CONFIGURATION_Handle *cfg, uint32_t off, if (hostname != NULL) { GNUNET_asprintf (&allowed_hosts, "%s; 127.0.0.1;", hostname); - GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-udp", "BINDTO", + GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "BINDTO", hostname); - GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-tcp", "BINDTO", + GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "INTERNAL_ADDRESS", hostname); + GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "EXTERNAL_ADDRESS", + hostname); + GNUNET_CONFIGURATION_set_value_string (uc.ret, "disablev6", "BINDTO", + "YES"); GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-tcp", "USE_LOCALADDR", "YES"); GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-udp", "USE_LOCALADDR", @@ -1467,14 +1471,18 @@ make_config(const struct GNUNET_CONFIGURATION_Handle *cfg, uint32_t off, } else { - GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-tcp", "BINDTO", - "127.0.0.1"); - GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-udp", "BINDTO", - "127.0.0.1"); GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-tcp", "USE_LOCALADDR", "YES"); GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-udp", "USE_LOCALADDR", "YES"); + GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "BINDTO", + "127.0.0.1"); + GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "INTERNAL_ADDRESS", + "127.0.0.1"); + GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "EXTERNAL_ADDRESS", + "127.0.0.1"); + GNUNET_CONFIGURATION_set_value_string (uc.ret, "disablev6", "BINDTO", + "YES"); } *port = (uint16_t) uc.nport; @@ -6114,7 +6122,30 @@ GNUNET_TESTING_daemons_start(const struct GNUNET_CONFIGURATION_Handle *cfg, { for (off = 0; off < hostcnt; off++) { - /* FIXME: grab baseservicehome! */ + + if (GNUNET_YES + == GNUNET_CONFIGURATION_get_value_string (pcfg, "PATHS", + "SERVICEHOME", + &baseservicehome)) + { + if (hostname != NULL) + GNUNET_asprintf (&newservicehome, "%s/%s/%d/", baseservicehome, hostname, off); + else + GNUNET_asprintf (&newservicehome, "%s/%d/", baseservicehome, off); + GNUNET_free (baseservicehome); + baseservicehome = NULL; + } + else + { + tmpdir = getenv ("TMPDIR"); + tmpdir = tmpdir ? tmpdir : "/tmp"; + if (hostname != NULL) + GNUNET_asprintf (&newservicehome, "%s/%s/%s/%d/", tmpdir, hostname, + "gnunet-testing-test-test", off); + else + GNUNET_asprintf (&newservicehome, "%s/%s/%d/", tmpdir, + "gnunet-testing-test-test", off); + } GNUNET_asprintf (&newservicehome, "%s/%s/", baseservicehome, @@ -6134,7 +6165,7 @@ GNUNET_TESTING_daemons_start(const struct GNUNET_CONFIGURATION_Handle *cfg, baseservicehome, pg->hosts[off].hostname); - // FIXME: free--- GNUNET_free (baseservicehome); + GNUNET_free (baseservicehome); /* FIXME: Doesn't support ssh_port option! */ proc = GNUNET_OS_start_process (NULL, NULL, -- 2.25.1