diff options
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/testing.c | 24 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_netjail_start_testsystem.c | 6 |
2 files changed, 22 insertions, 8 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c index fd0701d7d..6480d32f9 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -38,11 +38,11 @@ | |||
38 | 38 | ||
39 | #define LOG(kind, ...) GNUNET_log_from (kind, "testing-api", __VA_ARGS__) | 39 | #define LOG(kind, ...) GNUNET_log_from (kind, "testing-api", __VA_ARGS__) |
40 | 40 | ||
41 | #define CONNECT_ADDRESS_TEMPLATE "%s-192.168.15.%u:60002" | 41 | #define CONNECT_ADDRESS_TEMPLATE "%s-192.168.15.%u" |
42 | 42 | ||
43 | #define ROUTER_CONNECT_ADDRESS_TEMPLATE "%s-92.68.150.%u:60002" | 43 | #define ROUTER_CONNECT_ADDRESS_TEMPLATE "%s-92.68.150.%u" |
44 | 44 | ||
45 | #define KNOWN_CONNECT_ADDRESS_TEMPLATE "%s-92.68.151.%u:60002" | 45 | #define KNOWN_CONNECT_ADDRESS_TEMPLATE "%s-92.68.151.%u" |
46 | 46 | ||
47 | #define PREFIX_TCP "tcp" | 47 | #define PREFIX_TCP "tcp" |
48 | 48 | ||
@@ -2298,6 +2298,7 @@ GNUNET_TESTING_get_address (struct GNUNET_TESTING_NodeConnection *connection, | |||
2298 | struct GNUNET_TESTING_NetjailNode *node; | 2298 | struct GNUNET_TESTING_NetjailNode *node; |
2299 | char *addr; | 2299 | char *addr; |
2300 | char *template; | 2300 | char *template; |
2301 | unsigned int node_n; | ||
2301 | 2302 | ||
2302 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2303 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2303 | "node_n: %u\n", | 2304 | "node_n: %u\n", |
@@ -2307,14 +2308,17 @@ GNUNET_TESTING_get_address (struct GNUNET_TESTING_NodeConnection *connection, | |||
2307 | if (connection->namespace_n == node->namespace_n) | 2308 | if (connection->namespace_n == node->namespace_n) |
2308 | { | 2309 | { |
2309 | template = CONNECT_ADDRESS_TEMPLATE; | 2310 | template = CONNECT_ADDRESS_TEMPLATE; |
2311 | node_n = connection->node_n; | ||
2310 | } | 2312 | } |
2311 | else if (0 == connection->namespace_n) | 2313 | else if (0 == connection->namespace_n) |
2312 | { | 2314 | { |
2313 | template = KNOWN_CONNECT_ADDRESS_TEMPLATE; | 2315 | template = KNOWN_CONNECT_ADDRESS_TEMPLATE; |
2316 | node_n = connection->node_n; | ||
2314 | } | 2317 | } |
2315 | else if (1 == connection->node_n) | 2318 | else if (1 == connection->node_n) |
2316 | { | 2319 | { |
2317 | template = ROUTER_CONNECT_ADDRESS_TEMPLATE; | 2320 | template = ROUTER_CONNECT_ADDRESS_TEMPLATE; |
2321 | node_n = connection->namespace_n; | ||
2318 | } | 2322 | } |
2319 | else | 2323 | else |
2320 | { | 2324 | { |
@@ -2327,14 +2331,14 @@ GNUNET_TESTING_get_address (struct GNUNET_TESTING_NodeConnection *connection, | |||
2327 | GNUNET_asprintf (&addr, | 2331 | GNUNET_asprintf (&addr, |
2328 | template, | 2332 | template, |
2329 | prefix, | 2333 | prefix, |
2330 | connection->node_n); | 2334 | node_n); |
2331 | } | 2335 | } |
2332 | else if (0 == strcmp (PREFIX_UDP, prefix)) | 2336 | else if (0 == strcmp (PREFIX_UDP, prefix)) |
2333 | { | 2337 | { |
2334 | GNUNET_asprintf (&addr, | 2338 | GNUNET_asprintf (&addr, |
2335 | template, | 2339 | template, |
2336 | prefix, | 2340 | prefix, |
2337 | connection->node_n); | 2341 | node_n); |
2338 | } | 2342 | } |
2339 | else | 2343 | else |
2340 | { | 2344 | { |
@@ -2439,6 +2443,16 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2439 | out); | 2443 | out); |
2440 | topo->nodes_x = out; | 2444 | topo->nodes_x = out; |
2441 | } | 2445 | } |
2446 | else if (0 == strcmp (key, "AC")) | ||
2447 | { | ||
2448 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2449 | "Get first Value for AC.\n"); | ||
2450 | out = get_first_value (token); | ||
2451 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2452 | "AC: %u\n", | ||
2453 | out); | ||
2454 | topo->additional_connects = out; | ||
2455 | } | ||
2442 | else if (0 == strcmp (key, "T")) | 2456 | else if (0 == strcmp (key, "T")) |
2443 | { | 2457 | { |
2444 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2458 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/testing/testing_api_cmd_netjail_start_testsystem.c b/src/testing/testing_api_cmd_netjail_start_testsystem.c index 9f39fbfda..0624a7f46 100644 --- a/src/testing/testing_api_cmd_netjail_start_testsystem.c +++ b/src/testing/testing_api_cmd_netjail_start_testsystem.c | |||
@@ -499,11 +499,11 @@ helper_mst (void *cls, const struct GNUNET_MessageHeader *message) | |||
499 | static void | 499 | static void |
500 | exp_cb (void *cls) | 500 | exp_cb (void *cls) |
501 | { | 501 | { |
502 | struct TestingSystemCount *tbc = cls; | 502 | struct NetJailState *ns = cls; |
503 | 503 | ||
504 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called exp_cb.\n"); | 504 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called exp_cb.\n"); |
505 | GNUNET_SCHEDULER_cancel (tbc->ns->timeout_task); | 505 | GNUNET_SCHEDULER_cancel (ns->timeout_task); |
506 | GNUNET_TESTING_async_fail (&(tbc->ns->ac)); | 506 | GNUNET_TESTING_async_fail (&(ns->ac)); |
507 | } | 507 | } |
508 | 508 | ||
509 | 509 | ||