diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-07-26 10:33:53 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-07-26 10:33:53 +0000 |
commit | e8bc36209dd09c9720c6ea8657e4f49c35c08956 (patch) | |
tree | cad92ae0fc6097401beaad207e629d410f785e91 | |
parent | f2089e440b955fb4c7489885d3c414f59b739e6e (diff) | |
download | gnunet-e8bc36209dd09c9720c6ea8657e4f49c35c08956.tar.gz gnunet-e8bc36209dd09c9720c6ea8657e4f49c35c08956.zip |
fixes for remote peer testing
-rw-r--r-- | src/testing/testing_group.c | 47 |
1 files 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, | |||
1453 | if (hostname != NULL) | 1453 | if (hostname != NULL) |
1454 | { | 1454 | { |
1455 | GNUNET_asprintf (&allowed_hosts, "%s; 127.0.0.1;", hostname); | 1455 | GNUNET_asprintf (&allowed_hosts, "%s; 127.0.0.1;", hostname); |
1456 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-udp", "BINDTO", | 1456 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "BINDTO", |
1457 | hostname); | 1457 | hostname); |
1458 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-tcp", "BINDTO", | 1458 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "INTERNAL_ADDRESS", |
1459 | hostname); | 1459 | hostname); |
1460 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "EXTERNAL_ADDRESS", | ||
1461 | hostname); | ||
1462 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "disablev6", "BINDTO", | ||
1463 | "YES"); | ||
1460 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-tcp", "USE_LOCALADDR", | 1464 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-tcp", "USE_LOCALADDR", |
1461 | "YES"); | 1465 | "YES"); |
1462 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-udp", "USE_LOCALADDR", | 1466 | 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, | |||
1467 | } | 1471 | } |
1468 | else | 1472 | else |
1469 | { | 1473 | { |
1470 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-tcp", "BINDTO", | ||
1471 | "127.0.0.1"); | ||
1472 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-udp", "BINDTO", | ||
1473 | "127.0.0.1"); | ||
1474 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-tcp", "USE_LOCALADDR", | 1474 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-tcp", "USE_LOCALADDR", |
1475 | "YES"); | 1475 | "YES"); |
1476 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-udp", "USE_LOCALADDR", | 1476 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "transport-udp", "USE_LOCALADDR", |
1477 | "YES"); | 1477 | "YES"); |
1478 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "BINDTO", | ||
1479 | "127.0.0.1"); | ||
1480 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "INTERNAL_ADDRESS", | ||
1481 | "127.0.0.1"); | ||
1482 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "nat", "EXTERNAL_ADDRESS", | ||
1483 | "127.0.0.1"); | ||
1484 | GNUNET_CONFIGURATION_set_value_string (uc.ret, "disablev6", "BINDTO", | ||
1485 | "YES"); | ||
1478 | } | 1486 | } |
1479 | 1487 | ||
1480 | *port = (uint16_t) uc.nport; | 1488 | *port = (uint16_t) uc.nport; |
@@ -6114,7 +6122,30 @@ GNUNET_TESTING_daemons_start(const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
6114 | { | 6122 | { |
6115 | for (off = 0; off < hostcnt; off++) | 6123 | for (off = 0; off < hostcnt; off++) |
6116 | { | 6124 | { |
6117 | /* FIXME: grab baseservicehome! */ | 6125 | |
6126 | if (GNUNET_YES | ||
6127 | == GNUNET_CONFIGURATION_get_value_string (pcfg, "PATHS", | ||
6128 | "SERVICEHOME", | ||
6129 | &baseservicehome)) | ||
6130 | { | ||
6131 | if (hostname != NULL) | ||
6132 | GNUNET_asprintf (&newservicehome, "%s/%s/%d/", baseservicehome, hostname, off); | ||
6133 | else | ||
6134 | GNUNET_asprintf (&newservicehome, "%s/%d/", baseservicehome, off); | ||
6135 | GNUNET_free (baseservicehome); | ||
6136 | baseservicehome = NULL; | ||
6137 | } | ||
6138 | else | ||
6139 | { | ||
6140 | tmpdir = getenv ("TMPDIR"); | ||
6141 | tmpdir = tmpdir ? tmpdir : "/tmp"; | ||
6142 | if (hostname != NULL) | ||
6143 | GNUNET_asprintf (&newservicehome, "%s/%s/%s/%d/", tmpdir, hostname, | ||
6144 | "gnunet-testing-test-test", off); | ||
6145 | else | ||
6146 | GNUNET_asprintf (&newservicehome, "%s/%s/%d/", tmpdir, | ||
6147 | "gnunet-testing-test-test", off); | ||
6148 | } | ||
6118 | GNUNET_asprintf (&newservicehome, | 6149 | GNUNET_asprintf (&newservicehome, |
6119 | "%s/%s/", | 6150 | "%s/%s/", |
6120 | baseservicehome, | 6151 | baseservicehome, |
@@ -6134,7 +6165,7 @@ GNUNET_TESTING_daemons_start(const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
6134 | baseservicehome, | 6165 | baseservicehome, |
6135 | pg->hosts[off].hostname); | 6166 | pg->hosts[off].hostname); |
6136 | 6167 | ||
6137 | // FIXME: free--- GNUNET_free (baseservicehome); | 6168 | GNUNET_free (baseservicehome); |
6138 | 6169 | ||
6139 | /* FIXME: Doesn't support ssh_port option! */ | 6170 | /* FIXME: Doesn't support ssh_port option! */ |
6140 | proc = GNUNET_OS_start_process (NULL, NULL, | 6171 | proc = GNUNET_OS_start_process (NULL, NULL, |