diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_testing_netjail_lib.h | 49 | ||||
-rw-r--r-- | src/include/gnunet_testing_plugin.h | 6 | ||||
-rw-r--r-- | src/testing/gnunet-cmds-helper.c | 49 | ||||
-rw-r--r-- | src/testing/testing.c | 78 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_netjail_start_testsystem.c | 60 | ||||
-rw-r--r-- | src/testing/testing_cmds.h | 3 | ||||
-rw-r--r-- | src/transport/test_transport_plugin_cmd_simple_send.c | 51 | ||||
-rw-r--r-- | src/transport/test_transport_plugin_cmd_simple_send_broadcast.c | 41 | ||||
-rw-r--r-- | src/transport/test_transport_plugin_cmd_simple_send_dv.c | 41 | ||||
-rw-r--r-- | src/transport/test_transport_plugin_cmd_udp_backchannel.c | 39 |
10 files changed, 176 insertions, 241 deletions
diff --git a/src/include/gnunet_testing_netjail_lib.h b/src/include/gnunet_testing_netjail_lib.h index 3fbb88dd0..ea44e030d 100644 --- a/src/include/gnunet_testing_netjail_lib.h +++ b/src/include/gnunet_testing_netjail_lib.h | |||
@@ -320,7 +320,36 @@ unsigned int | |||
320 | GNUNET_TESTING_calculate_num (struct | 320 | GNUNET_TESTING_calculate_num (struct |
321 | GNUNET_TESTING_NodeConnection *node_connection, | 321 | GNUNET_TESTING_NodeConnection *node_connection, |
322 | struct GNUNET_TESTING_NetjailTopology *topology); | 322 | struct GNUNET_TESTING_NetjailTopology *topology); |
323 | struct TestState | ||
324 | { | ||
325 | /** | ||
326 | * Callback to write messages to the master loop. | ||
327 | * | ||
328 | */ | ||
329 | TESTING_CMD_HELPER_write_cb write_message; | ||
330 | |||
331 | /** | ||
332 | * Callback to notify the helper test case has finished. | ||
333 | */ | ||
334 | TESTING_CMD_HELPER_finish_cb finished_cb; | ||
323 | 335 | ||
336 | /** | ||
337 | * The name for a specific test environment directory. | ||
338 | * | ||
339 | */ | ||
340 | char *testdir; | ||
341 | |||
342 | /** | ||
343 | * The name for the configuration file of the specific node. | ||
344 | * | ||
345 | */ | ||
346 | char *cfgname; | ||
347 | |||
348 | /** | ||
349 | * The complete topology information. | ||
350 | */ | ||
351 | struct GNUNET_TESTING_NetjailTopology *topology; | ||
352 | }; | ||
324 | 353 | ||
325 | /** | 354 | /** |
326 | * Struct with information for callbacks. | 355 | * Struct with information for callbacks. |
@@ -362,7 +391,14 @@ struct LocalPreparedState | |||
362 | TESTING_CMD_HELPER_write_cb write_message; | 391 | TESTING_CMD_HELPER_write_cb write_message; |
363 | }; | 392 | }; |
364 | 393 | ||
365 | 394 | /** | |
395 | * Create command. | ||
396 | * | ||
397 | * @param label name for command. | ||
398 | * @param create_label Label of the cmd which started the test system. | ||
399 | * @param write_message Callback to write messages to the master loop. | ||
400 | * @return command. | ||
401 | */ | ||
366 | struct GNUNET_TESTING_Command | 402 | struct GNUNET_TESTING_Command |
367 | GNUNET_TESTING_cmd_system_destroy (const char *label, | 403 | GNUNET_TESTING_cmd_system_destroy (const char *label, |
368 | const char *create_label); | 404 | const char *create_label); |
@@ -438,11 +474,10 @@ GNUNET_TESTING_cmd_stop_testing_system ( | |||
438 | /** | 474 | /** |
439 | * Create a GNUNET_CMDS_LOCAL_FINISHED message. | 475 | * Create a GNUNET_CMDS_LOCAL_FINISHED message. |
440 | * | 476 | * |
441 | * @param rv The result of the local test as GNUNET_GenericReturnValue. | ||
442 | * @return The GNUNET_CMDS_LOCAL_FINISHED message. | 477 | * @return The GNUNET_CMDS_LOCAL_FINISHED message. |
443 | */ | 478 | */ |
444 | struct GNUNET_MessageHeader * | 479 | struct GNUNET_MessageHeader * |
445 | GNUNET_TESTING_send_local_test_finished_msg (enum GNUNET_GenericReturnValue rv); | 480 | GNUNET_TESTING_send_local_test_finished_msg (); |
446 | 481 | ||
447 | 482 | ||
448 | struct GNUNET_TESTING_Command | 483 | struct GNUNET_TESTING_Command |
@@ -482,7 +517,13 @@ struct GNUNET_TESTING_Command | |||
482 | GNUNET_TESTING_cmd_block_until_external_trigger ( | 517 | GNUNET_TESTING_cmd_block_until_external_trigger ( |
483 | const char *label); | 518 | const char *label); |
484 | 519 | ||
485 | 520 | /** | |
521 | * Create command. | ||
522 | * | ||
523 | * @param label name for command. | ||
524 | * @param write_message Callback to write messages to the master loop. | ||
525 | * @return command. | ||
526 | */ | ||
486 | struct GNUNET_TESTING_Command | 527 | struct GNUNET_TESTING_Command |
487 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, | 528 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, |
488 | TESTING_CMD_HELPER_write_cb write_message); | 529 | TESTING_CMD_HELPER_write_cb write_message); |
diff --git a/src/include/gnunet_testing_plugin.h b/src/include/gnunet_testing_plugin.h index b59d2cea1..9d0ef269d 100644 --- a/src/include/gnunet_testing_plugin.h +++ b/src/include/gnunet_testing_plugin.h | |||
@@ -41,6 +41,9 @@ typedef void | |||
41 | msg_length); | 41 | msg_length); |
42 | 42 | ||
43 | typedef void | 43 | typedef void |
44 | (*TESTING_CMD_HELPER_finish_cb) (); | ||
45 | |||
46 | typedef void | ||
44 | (*GNUNET_TESTING_PLUGIN_StartTestCase) (TESTING_CMD_HELPER_write_cb | 47 | (*GNUNET_TESTING_PLUGIN_StartTestCase) (TESTING_CMD_HELPER_write_cb |
45 | write_message, char *router_ip, | 48 | write_message, char *router_ip, |
46 | char *node_ip, | 49 | char *node_ip, |
@@ -48,7 +51,8 @@ typedef void | |||
48 | char *m, | 51 | char *m, |
49 | char *local_m, | 52 | char *local_m, |
50 | char *topology_data, | 53 | char *topology_data, |
51 | unsigned int *read_file); | 54 | unsigned int *read_file, |
55 | TESTING_CMD_HELPER_finish_cb finish_cb); | ||
52 | 56 | ||
53 | 57 | ||
54 | typedef void | 58 | typedef void |
diff --git a/src/testing/gnunet-cmds-helper.c b/src/testing/gnunet-cmds-helper.c index 178b1b133..be58f6f6a 100644 --- a/src/testing/gnunet-cmds-helper.c +++ b/src/testing/gnunet-cmds-helper.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "gnunet_util_lib.h" | 40 | #include "gnunet_util_lib.h" |
41 | #include "gnunet_testing_lib.h" | 41 | #include "gnunet_testing_lib.h" |
42 | #include "gnunet_testing_ng_lib.h" | 42 | #include "gnunet_testing_ng_lib.h" |
43 | #include "gnunet_testing_netjail_lib.h" | ||
43 | #include "testing_cmds.h" | 44 | #include "testing_cmds.h" |
44 | #include "gnunet_testing_plugin.h" | 45 | #include "gnunet_testing_plugin.h" |
45 | #include <zlib.h> | 46 | #include <zlib.h> |
@@ -61,6 +62,8 @@ testing_api_cmd_block_until_all_peers_started.c */ | |||
61 | 62 | ||
62 | #define ROUTER_BASE_IP "92.68.150." | 63 | #define ROUTER_BASE_IP "92.68.150." |
63 | 64 | ||
65 | struct GNUNET_SCHEDULER_Task *finished_task; | ||
66 | |||
64 | /** | 67 | /** |
65 | * Handle for a plugin. | 68 | * Handle for a plugin. |
66 | */ | 69 | */ |
@@ -232,7 +235,7 @@ static int status; | |||
232 | * @param cls NULL | 235 | * @param cls NULL |
233 | */ | 236 | */ |
234 | static void | 237 | static void |
235 | shutdown_task (void *cls) | 238 | do_shutdown (void *cls) |
236 | { | 239 | { |
237 | 240 | ||
238 | LOG_DEBUG ("Shutting down.\n"); | 241 | LOG_DEBUG ("Shutting down.\n"); |
@@ -276,6 +279,8 @@ write_task (void *cls) | |||
276 | bytes_wrote = GNUNET_DISK_file_write (stdout_fd, | 279 | bytes_wrote = GNUNET_DISK_file_write (stdout_fd, |
277 | wc->data + wc->pos, | 280 | wc->data + wc->pos, |
278 | wc->length - wc->pos); | 281 | wc->length - wc->pos); |
282 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
283 | "message send to master loop\n"); | ||
279 | if (GNUNET_SYSERR == bytes_wrote) | 284 | if (GNUNET_SYSERR == bytes_wrote) |
280 | { | 285 | { |
281 | LOG (GNUNET_ERROR_TYPE_WARNING, | 286 | LOG (GNUNET_ERROR_TYPE_WARNING, |
@@ -307,6 +312,8 @@ write_message (struct GNUNET_MessageHeader *message, size_t msg_length) | |||
307 | { | 312 | { |
308 | struct WriteContext *wc; | 313 | struct WriteContext *wc; |
309 | 314 | ||
315 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
316 | "write message to master loop\n"); | ||
310 | wc = GNUNET_new (struct WriteContext); | 317 | wc = GNUNET_new (struct WriteContext); |
311 | wc->length = msg_length; | 318 | wc->length = msg_length; |
312 | wc->data = message; | 319 | wc->data = message; |
@@ -317,6 +324,35 @@ write_message (struct GNUNET_MessageHeader *message, size_t msg_length) | |||
317 | wc); | 324 | wc); |
318 | } | 325 | } |
319 | 326 | ||
327 | static void | ||
328 | delay_shutdown_cb () | ||
329 | { | ||
330 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
331 | "doing shutdown after delay\n"); | ||
332 | GNUNET_SCHEDULER_shutdown (); | ||
333 | } | ||
334 | |||
335 | |||
336 | static void | ||
337 | finished_cb () | ||
338 | { | ||
339 | struct GNUNET_MessageHeader *reply; | ||
340 | |||
341 | reply = GNUNET_TESTING_send_local_test_finished_msg (); | ||
342 | |||
343 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
344 | "message prepared\n"); | ||
345 | write_message (reply, ntohs (reply->size)); | ||
346 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
347 | "message send\n"); | ||
348 | |||
349 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
350 | "delaying shutdown\n"); | ||
351 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, | ||
352 | delay_shutdown_cb, | ||
353 | NULL); | ||
354 | } | ||
355 | |||
320 | 356 | ||
321 | /** | 357 | /** |
322 | * Functions with this signature are called whenever a | 358 | * Functions with this signature are called whenever a |
@@ -341,11 +377,16 @@ tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message) | |||
341 | char *plugin_name; | 377 | char *plugin_name; |
342 | size_t plugin_name_size; | 378 | size_t plugin_name_size; |
343 | uint16_t msize; | 379 | uint16_t msize; |
380 | uint16_t type; | ||
344 | size_t msg_length; | 381 | size_t msg_length; |
345 | char *router_ip; | 382 | char *router_ip; |
346 | char *node_ip; | 383 | char *node_ip; |
347 | unsigned int namespace_n; | 384 | unsigned int namespace_n; |
348 | 385 | ||
386 | type = ntohs (message->type); | ||
387 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
388 | "Received message type %u\n", | ||
389 | type); | ||
349 | msize = ntohs (message->size); | 390 | msize = ntohs (message->size); |
350 | if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_INIT == ntohs (message->type)) | 391 | if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_INIT == ntohs (message->type)) |
351 | { | 392 | { |
@@ -402,7 +443,7 @@ tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message) | |||
402 | 443 | ||
403 | plugin->api->start_testcase (&write_message, router_ip, node_ip, plugin->m, | 444 | plugin->api->start_testcase (&write_message, router_ip, node_ip, plugin->m, |
404 | plugin->n, plugin->local_m, ni->topology_data, | 445 | plugin->n, plugin->local_m, ni->topology_data, |
405 | ni->read_file); | 446 | ni->read_file, &finished_cb); |
406 | 447 | ||
407 | msg_length = sizeof(struct GNUNET_CMDS_HelperReply); | 448 | msg_length = sizeof(struct GNUNET_CMDS_HelperReply); |
408 | reply = GNUNET_new (struct GNUNET_CMDS_HelperReply); | 449 | reply = GNUNET_new (struct GNUNET_CMDS_HelperReply); |
@@ -522,7 +563,7 @@ run (void *cls, | |||
522 | stdin_fd, | 563 | stdin_fd, |
523 | &read_task, | 564 | &read_task, |
524 | NULL); | 565 | NULL); |
525 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL); | 566 | GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); |
526 | } | 567 | } |
527 | 568 | ||
528 | 569 | ||
@@ -629,6 +670,8 @@ main (int argc, char **argv) | |||
629 | &run, | 670 | &run, |
630 | ni); | 671 | ni); |
631 | 672 | ||
673 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
674 | "Finishing helper\n"); | ||
632 | GNUNET_SIGNAL_handler_uninstall (shc_chld); | 675 | GNUNET_SIGNAL_handler_uninstall (shc_chld); |
633 | shc_chld = NULL; | 676 | shc_chld = NULL; |
634 | GNUNET_DISK_pipe_close (sigpipe); | 677 | GNUNET_DISK_pipe_close (sigpipe); |
diff --git a/src/testing/testing.c b/src/testing/testing.c index 4f0b8eaa9..95651830f 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -1319,7 +1319,7 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system, | |||
1319 | peer->nports = nports; | 1319 | peer->nports = nports; |
1320 | return peer; | 1320 | return peer; |
1321 | 1321 | ||
1322 | err_ret: | 1322 | err_ret: |
1323 | GNUNET_free (ss_instances); | 1323 | GNUNET_free (ss_instances); |
1324 | GNUNET_free (ports); | 1324 | GNUNET_free (ports); |
1325 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s", emsg_); | 1325 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s", emsg_); |
@@ -2118,7 +2118,7 @@ get_node_info (unsigned int num, | |||
2118 | unsigned int node_m; | 2118 | unsigned int node_m; |
2119 | struct GNUNET_TESTING_NetjailNode *node; | 2119 | struct GNUNET_TESTING_NetjailNode *node; |
2120 | struct GNUNET_TESTING_NetjailNamespace *namespace; | 2120 | struct GNUNET_TESTING_NetjailNamespace *namespace; |
2121 | struct GNUNET_TESTING_NodeConnection *node_connections; | 2121 | struct GNUNET_TESTING_NodeConnection *node_connections = NULL; |
2122 | 2122 | ||
2123 | log_topo (topology); | 2123 | log_topo (topology); |
2124 | hkey = GNUNET_new (struct GNUNET_ShortHashCode); | 2124 | hkey = GNUNET_new (struct GNUNET_ShortHashCode); |
@@ -2135,7 +2135,10 @@ get_node_info (unsigned int num, | |||
2135 | node = GNUNET_CONTAINER_multishortmap_get (topology->map_globals, | 2135 | node = GNUNET_CONTAINER_multishortmap_get (topology->map_globals, |
2136 | hkey); | 2136 | hkey); |
2137 | if (NULL != node) | 2137 | if (NULL != node) |
2138 | node_connections = node->node_connections_head; | 2138 | { |
2139 | *node_ex = node; | ||
2140 | *node_connections_ex = node->node_connections_head; | ||
2141 | } | ||
2139 | } | 2142 | } |
2140 | else | 2143 | else |
2141 | { | 2144 | { |
@@ -2248,8 +2251,15 @@ free_nodes_cb (void *cls, | |||
2248 | { | 2251 | { |
2249 | while (NULL != (pos_prefix = pos_connection->address_prefixes_head)) | 2252 | while (NULL != (pos_prefix = pos_connection->address_prefixes_head)) |
2250 | { | 2253 | { |
2254 | GNUNET_CONTAINER_DLL_remove (pos_connection->address_prefixes_head, | ||
2255 | pos_connection->address_prefixes_tail, | ||
2256 | pos_prefix); | ||
2251 | GNUNET_free (pos_prefix->address_prefix); | 2257 | GNUNET_free (pos_prefix->address_prefix); |
2258 | GNUNET_free (pos_prefix); | ||
2252 | } | 2259 | } |
2260 | GNUNET_CONTAINER_DLL_remove (node->node_connections_head, | ||
2261 | node->node_connections_tail, | ||
2262 | pos_connection); | ||
2253 | GNUNET_free (pos_connection); | 2263 | GNUNET_free (pos_connection); |
2254 | } | 2264 | } |
2255 | 2265 | ||
@@ -2398,9 +2408,11 @@ GNUNET_TESTING_get_additional_connects (unsigned int num, | |||
2398 | get_node_info (num, topology, &node, &namespace, &node_connections); | 2408 | get_node_info (num, topology, &node, &namespace, &node_connections); |
2399 | 2409 | ||
2400 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2410 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2401 | "node additional_connects: %u %p\n", | 2411 | "node additional_connects for node %p\n", |
2402 | node->additional_connects, | ||
2403 | node); | 2412 | node); |
2413 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2414 | "node additional_connects: %u\n", | ||
2415 | node->additional_connects); | ||
2404 | 2416 | ||
2405 | return node->additional_connects; | 2417 | return node->additional_connects; |
2406 | } | 2418 | } |
@@ -2409,28 +2421,47 @@ GNUNET_TESTING_get_additional_connects (unsigned int num, | |||
2409 | /** | 2421 | /** |
2410 | * Create a GNUNET_CMDS_LOCAL_FINISHED message. | 2422 | * Create a GNUNET_CMDS_LOCAL_FINISHED message. |
2411 | * | 2423 | * |
2412 | * @param rv The result of the local test as GNUNET_GenericReturnValue. | ||
2413 | * @return The GNUNET_CMDS_LOCAL_FINISHED message. | 2424 | * @return The GNUNET_CMDS_LOCAL_FINISHED message. |
2414 | */ | 2425 | */ |
2415 | struct GNUNET_MessageHeader * | 2426 | struct GNUNET_MessageHeader * |
2416 | GNUNET_TESTING_send_local_test_finished_msg (enum GNUNET_GenericReturnValue rv) | 2427 | GNUNET_TESTING_send_local_test_finished_msg () |
2417 | { | 2428 | { |
2418 | struct GNUNET_CMDS_LOCAL_FINISHED *reply; | 2429 | struct GNUNET_CMDS_LOCAL_FINISHED *reply; |
2419 | size_t msg_length; | 2430 | size_t msg_length; |
2420 | 2431 | ||
2421 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2422 | "Local test exits with status %d\n", | ||
2423 | rv); | ||
2424 | msg_length = sizeof(struct GNUNET_CMDS_LOCAL_FINISHED); | 2432 | msg_length = sizeof(struct GNUNET_CMDS_LOCAL_FINISHED); |
2425 | reply = GNUNET_new (struct GNUNET_CMDS_LOCAL_FINISHED); | 2433 | reply = GNUNET_new (struct GNUNET_CMDS_LOCAL_FINISHED); |
2426 | reply->header.type = htons (GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED); | 2434 | reply->header.type = htons (GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED); |
2427 | reply->header.size = htons ((uint16_t) msg_length); | 2435 | reply->header.size = htons ((uint16_t) msg_length); |
2428 | reply->result = htons (rv); | ||
2429 | 2436 | ||
2430 | return (struct GNUNET_MessageHeader *) reply; | 2437 | return (struct GNUNET_MessageHeader *) reply; |
2431 | } | 2438 | } |
2432 | 2439 | ||
2433 | 2440 | ||
2441 | static void | ||
2442 | parse_ac (struct GNUNET_TESTING_NetjailNode *p_node, char *token) | ||
2443 | { | ||
2444 | char *ac_value; | ||
2445 | |||
2446 | ac_value = get_value ("AC", token); | ||
2447 | if (NULL != ac_value) | ||
2448 | { | ||
2449 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2450 | "ac value: %s\n", | ||
2451 | ac_value); | ||
2452 | sscanf (ac_value, "%u", &p_node->additional_connects); | ||
2453 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2454 | "AC %u\n", | ||
2455 | p_node->additional_connects); | ||
2456 | } | ||
2457 | else | ||
2458 | { | ||
2459 | p_node->additional_connects = 0; | ||
2460 | } | ||
2461 | GNUNET_free (ac_value); | ||
2462 | } | ||
2463 | |||
2464 | |||
2434 | /** | 2465 | /** |
2435 | * Parse the topology data. | 2466 | * Parse the topology data. |
2436 | * | 2467 | * |
@@ -2446,7 +2477,6 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2446 | char *rest = NULL; | 2477 | char *rest = NULL; |
2447 | char *value = NULL; | 2478 | char *value = NULL; |
2448 | char *value2; | 2479 | char *value2; |
2449 | char *ac_value; | ||
2450 | int ret; | 2480 | int ret; |
2451 | struct GNUNET_TESTING_NetjailTopology *topo; | 2481 | struct GNUNET_TESTING_NetjailTopology *topo; |
2452 | struct GNUNET_TESTING_NetjailRouter *router; | 2482 | struct GNUNET_TESTING_NetjailRouter *router; |
@@ -2555,6 +2585,7 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2555 | "value: %s\n", | 2585 | "value: %s\n", |
2556 | value); | 2586 | value); |
2557 | k_node->plugin = value; | 2587 | k_node->plugin = value; |
2588 | parse_ac (k_node, token); | ||
2558 | node_connections (token, k_node); | 2589 | node_connections (token, k_node); |
2559 | GNUNET_free (value); | 2590 | GNUNET_free (value); |
2560 | } | 2591 | } |
@@ -2617,6 +2648,7 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2617 | { | 2648 | { |
2618 | struct GNUNET_TESTING_NetjailNode *p_node = GNUNET_new (struct | 2649 | struct GNUNET_TESTING_NetjailNode *p_node = GNUNET_new (struct |
2619 | GNUNET_TESTING_NetjailNode); | 2650 | GNUNET_TESTING_NetjailNode); |
2651 | hkey = GNUNET_new (struct GNUNET_ShortHashCode); | ||
2620 | 2652 | ||
2621 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2653 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2622 | "Get first Value for P.\n"); | 2654 | "Get first Value for P.\n"); |
@@ -2672,26 +2704,22 @@ GNUNET_TESTING_get_topo_from_string (char *data) | |||
2672 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2704 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2673 | "Get value for key plugin on P.\n"); | 2705 | "Get value for key plugin on P.\n"); |
2674 | value = get_value ("plugin", token); | 2706 | value = get_value ("plugin", token); |
2675 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2707 | if (NULL != value) |
2676 | "plugin: %s\n", | 2708 | { |
2677 | value); | 2709 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2678 | memcpy (p_node->plugin, value, sizeof (*value)); | 2710 | "plugin: %s\n", |
2711 | value); | ||
2712 | p_node->plugin = GNUNET_malloc (sizeof(*value)); | ||
2713 | memcpy (p_node->plugin, value, sizeof (*value)); | ||
2714 | } | ||
2679 | GNUNET_free (value); | 2715 | GNUNET_free (value); |
2680 | p_node->node_n = out; | 2716 | p_node->node_n = out; |
2681 | p_node->namespace_n = namespace->namespace_n; | 2717 | p_node->namespace_n = namespace->namespace_n; |
2682 | } | 2718 | } |
2683 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2719 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2684 | "Get AC Value for P.\n"); | 2720 | "Get AC Value for P.\n"); |
2685 | ac_value = get_value ("AC", token); | 2721 | parse_ac (p_node, token); |
2686 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2687 | "ac value: %s\n", | ||
2688 | ac_value); | ||
2689 | sscanf (ac_value, "%u", &p_node->additional_connects); | ||
2690 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
2691 | "P:AC %u\n", | ||
2692 | p_node->additional_connects); | ||
2693 | node_connections (token, p_node); | 2722 | node_connections (token, p_node); |
2694 | GNUNET_free (ac_value); | ||
2695 | } | 2723 | } |
2696 | token = strtok_r (NULL, "\n", &rest); | 2724 | token = strtok_r (NULL, "\n", &rest); |
2697 | if (NULL != token) | 2725 | if (NULL != token) |
diff --git a/src/testing/testing_api_cmd_netjail_start_testsystem.c b/src/testing/testing_api_cmd_netjail_start_testsystem.c index 972c566d6..98de0698a 100644 --- a/src/testing/testing_api_cmd_netjail_start_testsystem.c +++ b/src/testing/testing_api_cmd_netjail_start_testsystem.c | |||
@@ -414,66 +414,6 @@ helper_mst (void *cls, const struct GNUNET_MessageHeader *message) | |||
414 | // We received a message we can not handle. | 414 | // We received a message we can not handle. |
415 | GNUNET_assert (0); | 415 | GNUNET_assert (0); |
416 | } | 416 | } |
417 | /*if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_REPLY == ntohs (message->type)) | ||
418 | { | ||
419 | ns->number_of_testsystems_started++; | ||
420 | } | ||
421 | else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_PEER_STARTED == ntohs ( | ||
422 | message->type)) | ||
423 | { | ||
424 | ns->number_of_peers_started++; | ||
425 | if (ns->number_of_peers_started == total_number) | ||
426 | { | ||
427 | for (int i = 1; i <= ns->known; i++) | ||
428 | { | ||
429 | send_all_peers_started (0,i, ns); | ||
430 | } | ||
431 | |||
432 | for (int i = 1; i <= ns->global_n; i++) | ||
433 | { | ||
434 | for (int j = 1; j <= ns->local_m; j++) | ||
435 | { | ||
436 | send_all_peers_started (i,j, ns); | ||
437 | } | ||
438 | } | ||
439 | ns->number_of_peers_started = 0; | ||
440 | } | ||
441 | } | ||
442 | else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_TEST_PREPARED == ntohs ( | ||
443 | message->type)) | ||
444 | { | ||
445 | ns->number_of_local_tests_prepared++; | ||
446 | if (ns->number_of_local_tests_prepared == total_number) | ||
447 | { | ||
448 | for (int i = 1; i <= ns->known; i++) | ||
449 | { | ||
450 | send_all_local_tests_prepared (0,i, ns); | ||
451 | } | ||
452 | |||
453 | for (int i = 1; i <= ns->global_n; i++) | ||
454 | { | ||
455 | for (int j = 1; j <= ns->local_m; j++) | ||
456 | { | ||
457 | send_all_local_tests_prepared (i,j, ns); | ||
458 | } | ||
459 | } | ||
460 | } | ||
461 | } | ||
462 | else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED == ntohs ( | ||
463 | message->type)) | ||
464 | { | ||
465 | ns->number_of_local_tests_finished++; | ||
466 | if (ns->number_of_local_tests_finished == total_number) | ||
467 | { | ||
468 | GNUNET_TESTING_async_finish (&ns->ac); | ||
469 | } | ||
470 | } | ||
471 | else | ||
472 | { | ||
473 | // We received a message we can not handle. | ||
474 | GNUNET_assert (0); | ||
475 | }*/ | ||
476 | |||
477 | 417 | ||
478 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 418 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
479 | "total %u sysstarted %u peersstarted %u prep %u finished %u %u %u %u\n", | 419 | "total %u sysstarted %u peersstarted %u prep %u finished %u %u %u %u\n", |
diff --git a/src/testing/testing_cmds.h b/src/testing/testing_cmds.h index 12db87d19..c4246d51e 100644 --- a/src/testing/testing_cmds.h +++ b/src/testing/testing_cmds.h | |||
@@ -83,10 +83,9 @@ struct GNUNET_CMDS_LOCAL_FINISHED | |||
83 | * Type is GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED | 83 | * Type is GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED |
84 | */ | 84 | */ |
85 | struct GNUNET_MessageHeader header; | 85 | struct GNUNET_MessageHeader header; |
86 | |||
87 | enum GNUNET_GenericReturnValue result; | ||
88 | }; | 86 | }; |
89 | 87 | ||
88 | |||
90 | struct GNUNET_CMDS_LOCAL_TEST_PREPARED | 89 | struct GNUNET_CMDS_LOCAL_TEST_PREPARED |
91 | { | 90 | { |
92 | /** | 91 | /** |
diff --git a/src/transport/test_transport_plugin_cmd_simple_send.c b/src/transport/test_transport_plugin_cmd_simple_send.c index a59452449..ee6b9669b 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send.c +++ b/src/transport/test_transport_plugin_cmd_simple_send.c | |||
@@ -40,32 +40,6 @@ | |||
40 | 40 | ||
41 | #define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" | 41 | #define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" |
42 | 42 | ||
43 | struct TestState | ||
44 | { | ||
45 | /** | ||
46 | * Callback to write messages to the master loop. | ||
47 | * | ||
48 | */ | ||
49 | TESTING_CMD_HELPER_write_cb write_message; | ||
50 | |||
51 | /** | ||
52 | * The name for a specific test environment directory. | ||
53 | * | ||
54 | */ | ||
55 | char *testdir; | ||
56 | |||
57 | /** | ||
58 | * The name for the configuration file of the specific node. | ||
59 | * | ||
60 | */ | ||
61 | char *cfgname; | ||
62 | |||
63 | /** | ||
64 | * The complete topology information. | ||
65 | */ | ||
66 | struct GNUNET_TESTING_NetjailTopology *topology; | ||
67 | }; | ||
68 | |||
69 | static struct GNUNET_TESTING_Command block_send; | 43 | static struct GNUNET_TESTING_Command block_send; |
70 | 44 | ||
71 | static struct GNUNET_TESTING_Command block_receive; | 45 | static struct GNUNET_TESTING_Command block_receive; |
@@ -144,14 +118,10 @@ handle_result (void *cls, | |||
144 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 118 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
145 | "Local test exits with status %d\n", | 119 | "Local test exits with status %d\n", |
146 | rv); | 120 | rv); |
147 | reply = GNUNET_TESTING_send_local_test_finished_msg (rv); | ||
148 | 121 | ||
149 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 122 | reply = GNUNET_TESTING_send_local_test_finished_msg (); |
150 | "message prepared\n"); | 123 | |
151 | ts->write_message (reply, | 124 | ts->finished_cb (); |
152 | ntohs (reply->size)); | ||
153 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
154 | "message send\n"); | ||
155 | GNUNET_free (ts->testdir); | 125 | GNUNET_free (ts->testdir); |
156 | GNUNET_free (ts->cfgname); | 126 | GNUNET_free (ts->cfgname); |
157 | GNUNET_TESTING_free_topology (ts->topology); | 127 | GNUNET_TESTING_free_topology (ts->topology); |
@@ -218,7 +188,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
218 | char *n, | 188 | char *n, |
219 | char *local_m, | 189 | char *local_m, |
220 | char *topology_data, | 190 | char *topology_data, |
221 | unsigned int *read_file) | 191 | unsigned int *read_file, |
192 | TESTING_CMD_HELPER_finish_cb finished_cb) | ||
222 | { | 193 | { |
223 | 194 | ||
224 | unsigned int n_int; | 195 | unsigned int n_int; |
@@ -229,6 +200,12 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
229 | struct GNUNET_TESTING_NetjailTopology *topology; | 200 | struct GNUNET_TESTING_NetjailTopology *topology; |
230 | unsigned int sscanf_ret = 0; | 201 | unsigned int sscanf_ret = 0; |
231 | 202 | ||
203 | ts->finished_cb = finished_cb; | ||
204 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
205 | "n %s m %s\n", | ||
206 | n, | ||
207 | m); | ||
208 | |||
232 | if (GNUNET_YES == *read_file) | 209 | if (GNUNET_YES == *read_file) |
233 | { | 210 | { |
234 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 211 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -241,21 +218,21 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
241 | ts->topology = topology; | 218 | ts->topology = topology; |
242 | 219 | ||
243 | errno = 0; | 220 | errno = 0; |
244 | sscanf (m, "%u", &m_int); | 221 | sscanf_ret = sscanf (m, "%u", &m_int); |
245 | if (errno != 0) | 222 | if (errno != 0) |
246 | { | 223 | { |
247 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | 224 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); |
248 | } | 225 | } |
249 | GNUNET_assert (0 < sscanf_ret); | 226 | GNUNET_assert (0 < sscanf_ret); |
250 | errno = 0; | 227 | errno = 0; |
251 | sscanf (n, "%u", &n_int); | 228 | sscanf_ret = sscanf (n, "%u", &n_int); |
252 | if (errno != 0) | 229 | if (errno != 0) |
253 | { | 230 | { |
254 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | 231 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); |
255 | } | 232 | } |
256 | GNUNET_assert (0 < sscanf_ret); | 233 | GNUNET_assert (0 < sscanf_ret); |
257 | errno = 0; | 234 | errno = 0; |
258 | sscanf (local_m, "%u", &local_m_int); | 235 | sscanf_ret = sscanf (local_m, "%u", &local_m_int); |
259 | if (errno != 0) | 236 | if (errno != 0) |
260 | { | 237 | { |
261 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | 238 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); |
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c index 9d6844be1..6254dba36 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c +++ b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c | |||
@@ -40,32 +40,6 @@ | |||
40 | 40 | ||
41 | #define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" | 41 | #define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" |
42 | 42 | ||
43 | struct TestState | ||
44 | { | ||
45 | /** | ||
46 | * Callback to write messages to the master loop. | ||
47 | * | ||
48 | */ | ||
49 | TESTING_CMD_HELPER_write_cb write_message; | ||
50 | |||
51 | /** | ||
52 | * The name for a specific test environment directory. | ||
53 | * | ||
54 | */ | ||
55 | char *testdir; | ||
56 | |||
57 | /** | ||
58 | * The name for the configuration file of the specific node. | ||
59 | * | ||
60 | */ | ||
61 | char *cfgname; | ||
62 | |||
63 | /** | ||
64 | * The complete topology information. | ||
65 | */ | ||
66 | struct GNUNET_TESTING_NetjailTopology *topology; | ||
67 | }; | ||
68 | |||
69 | static struct GNUNET_TESTING_Command block_send; | 43 | static struct GNUNET_TESTING_Command block_send; |
70 | 44 | ||
71 | static struct GNUNET_TESTING_Command block_receive; | 45 | static struct GNUNET_TESTING_Command block_receive; |
@@ -140,19 +114,11 @@ handle_result (void *cls, | |||
140 | enum GNUNET_GenericReturnValue rv) | 114 | enum GNUNET_GenericReturnValue rv) |
141 | { | 115 | { |
142 | struct TestState *ts = cls; | 116 | struct TestState *ts = cls; |
143 | struct GNUNET_MessageHeader *reply; | ||
144 | 117 | ||
145 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 118 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
146 | "Local test exits with status %d\n", | 119 | "Local test exits with status %d\n", |
147 | rv); | 120 | rv); |
148 | reply = GNUNET_TESTING_send_local_test_finished_msg (rv); | 121 | ts->finished_cb (); |
149 | |||
150 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
151 | "message prepared\n"); | ||
152 | ts->write_message (reply, | ||
153 | ntohs (reply->size)); | ||
154 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
155 | "message send\n"); | ||
156 | GNUNET_free (ts->testdir); | 122 | GNUNET_free (ts->testdir); |
157 | GNUNET_free (ts->cfgname); | 123 | GNUNET_free (ts->cfgname); |
158 | GNUNET_TESTING_free_topology (ts->topology); | 124 | GNUNET_TESTING_free_topology (ts->topology); |
@@ -251,7 +217,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
251 | char *n, | 217 | char *n, |
252 | char *local_m, | 218 | char *local_m, |
253 | char *topology_data, | 219 | char *topology_data, |
254 | unsigned int *read_file) | 220 | unsigned int *read_file, |
221 | TESTING_CMD_HELPER_finish_cb finished_cb) | ||
255 | { | 222 | { |
256 | unsigned int n_int; | 223 | unsigned int n_int; |
257 | unsigned int m_int; | 224 | unsigned int m_int; |
@@ -261,7 +228,7 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
261 | struct GNUNET_TESTING_NetjailTopology *topology; | 228 | struct GNUNET_TESTING_NetjailTopology *topology; |
262 | 229 | ||
263 | 230 | ||
264 | 231 | ts->finished_cb = finished_cb; | |
265 | if (GNUNET_YES == *read_file) | 232 | if (GNUNET_YES == *read_file) |
266 | { | 233 | { |
267 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 234 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_dv.c b/src/transport/test_transport_plugin_cmd_simple_send_dv.c index 3ef2f64cd..ea0c9aea8 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send_dv.c +++ b/src/transport/test_transport_plugin_cmd_simple_send_dv.c | |||
@@ -40,33 +40,6 @@ | |||
40 | 40 | ||
41 | #define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" | 41 | #define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" |
42 | 42 | ||
43 | struct TestState | ||
44 | { | ||
45 | /** | ||
46 | * Callback to write messages to the master loop. | ||
47 | * | ||
48 | */ | ||
49 | TESTING_CMD_HELPER_write_cb write_message; | ||
50 | |||
51 | /** | ||
52 | * The name for a specific test environment directory. | ||
53 | * | ||
54 | */ | ||
55 | char *testdir; | ||
56 | |||
57 | /** | ||
58 | * The name for the configuration file of the specific node. | ||
59 | * | ||
60 | */ | ||
61 | char *cfgname; | ||
62 | |||
63 | /** | ||
64 | * The complete topology information. | ||
65 | */ | ||
66 | struct GNUNET_TESTING_NetjailTopology *topology; | ||
67 | |||
68 | }; | ||
69 | |||
70 | /** | 43 | /** |
71 | * The number of messages received. | 44 | * The number of messages received. |
72 | */ | 45 | */ |
@@ -193,19 +166,11 @@ handle_result (void *cls, | |||
193 | enum GNUNET_GenericReturnValue rv) | 166 | enum GNUNET_GenericReturnValue rv) |
194 | { | 167 | { |
195 | struct TestState *ts = cls; | 168 | struct TestState *ts = cls; |
196 | struct GNUNET_MessageHeader *reply; | ||
197 | 169 | ||
198 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 170 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
199 | "Local test exits with status %d\n", | 171 | "Local test exits with status %d\n", |
200 | rv); | 172 | rv); |
201 | reply = GNUNET_TESTING_send_local_test_finished_msg (rv); | 173 | ts->finished_cb (); |
202 | |||
203 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
204 | "message prepared\n"); | ||
205 | ts->write_message (reply, | ||
206 | ntohs (reply->size)); | ||
207 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
208 | "message send\n"); | ||
209 | GNUNET_free (ts->testdir); | 174 | GNUNET_free (ts->testdir); |
210 | GNUNET_free (ts->cfgname); | 175 | GNUNET_free (ts->cfgname); |
211 | GNUNET_TESTING_free_topology (ts->topology); | 176 | GNUNET_TESTING_free_topology (ts->topology); |
@@ -275,7 +240,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
275 | char *n, | 240 | char *n, |
276 | char *local_m, | 241 | char *local_m, |
277 | char *topology_data, | 242 | char *topology_data, |
278 | unsigned int *read_file) | 243 | unsigned int *read_file, |
244 | TESTING_CMD_HELPER_finish_cb finished_cb) | ||
279 | { | 245 | { |
280 | unsigned int n_int; | 246 | unsigned int n_int; |
281 | unsigned int m_int; | 247 | unsigned int m_int; |
@@ -291,6 +257,7 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
291 | GNUNET_MQ_handler_end () | 257 | GNUNET_MQ_handler_end () |
292 | }; | 258 | }; |
293 | 259 | ||
260 | ts->finished_cb = finished_cb; | ||
294 | if (GNUNET_YES == *read_file) | 261 | if (GNUNET_YES == *read_file) |
295 | { | 262 | { |
296 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 263 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/transport/test_transport_plugin_cmd_udp_backchannel.c b/src/transport/test_transport_plugin_cmd_udp_backchannel.c index 537832e61..87065e340 100644 --- a/src/transport/test_transport_plugin_cmd_udp_backchannel.c +++ b/src/transport/test_transport_plugin_cmd_udp_backchannel.c | |||
@@ -40,32 +40,6 @@ | |||
40 | 40 | ||
41 | #define TOPOLOGY_CONFIG "test_transport_udp_backchannel_topo.conf" | 41 | #define TOPOLOGY_CONFIG "test_transport_udp_backchannel_topo.conf" |
42 | 42 | ||
43 | struct TestState | ||
44 | { | ||
45 | /** | ||
46 | * Callback to write messages to the master loop. | ||
47 | * | ||
48 | */ | ||
49 | TESTING_CMD_HELPER_write_cb write_message; | ||
50 | |||
51 | /** | ||
52 | * The name for a specific test environment directory. | ||
53 | * | ||
54 | */ | ||
55 | char *testdir; | ||
56 | |||
57 | /** | ||
58 | * The name for the configuration file of the specific node. | ||
59 | * | ||
60 | */ | ||
61 | char *cfgname; | ||
62 | |||
63 | /** | ||
64 | * The complete topology information. | ||
65 | */ | ||
66 | struct GNUNET_TESTING_NetjailTopology *topology; | ||
67 | }; | ||
68 | |||
69 | static struct GNUNET_TESTING_Command block_send; | 43 | static struct GNUNET_TESTING_Command block_send; |
70 | 44 | ||
71 | static struct GNUNET_TESTING_Command connect_peers; | 45 | static struct GNUNET_TESTING_Command connect_peers; |
@@ -136,18 +110,12 @@ handle_result (void *cls, | |||
136 | enum GNUNET_GenericReturnValue rv) | 110 | enum GNUNET_GenericReturnValue rv) |
137 | { | 111 | { |
138 | struct TestState *ts = cls; | 112 | struct TestState *ts = cls; |
139 | struct GNUNET_MessageHeader *reply; | ||
140 | 113 | ||
141 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 114 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
142 | "Local test exits with status %d\n", | 115 | "Local test exits with status %d\n", |
143 | rv); | 116 | rv); |
144 | reply = GNUNET_TESTING_send_local_test_finished_msg (rv); | ||
145 | |||
146 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
147 | "message prepared\n"); | ||
148 | ts->write_message (reply, | ||
149 | ntohs (reply->size)); | ||
150 | 117 | ||
118 | ts->finished_cb (); | ||
151 | GNUNET_free (ts->testdir); | 119 | GNUNET_free (ts->testdir); |
152 | GNUNET_free (ts->cfgname); | 120 | GNUNET_free (ts->cfgname); |
153 | GNUNET_TESTING_free_topology (ts->topology); | 121 | GNUNET_TESTING_free_topology (ts->topology); |
@@ -209,7 +177,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
209 | char *n, | 177 | char *n, |
210 | char *local_m, | 178 | char *local_m, |
211 | char *topology_data, | 179 | char *topology_data, |
212 | unsigned int *read_file) | 180 | unsigned int *read_file, |
181 | TESTING_CMD_HELPER_finish_cb finished_cb) | ||
213 | { | 182 | { |
214 | 183 | ||
215 | unsigned int n_int; | 184 | unsigned int n_int; |
@@ -217,9 +186,9 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
217 | unsigned int local_m_int; | 186 | unsigned int local_m_int; |
218 | unsigned int num; | 187 | unsigned int num; |
219 | struct TestState *ts = GNUNET_new (struct TestState); | 188 | struct TestState *ts = GNUNET_new (struct TestState); |
220 | |||
221 | struct GNUNET_TESTING_NetjailTopology *topology; | 189 | struct GNUNET_TESTING_NetjailTopology *topology; |
222 | 190 | ||
191 | ts->finished_cb = finished_cb; | ||
223 | if (GNUNET_YES == *read_file) | 192 | if (GNUNET_YES == *read_file) |
224 | topology = GNUNET_TESTING_get_topo_from_file (topology_data); | 193 | topology = GNUNET_TESTING_get_topo_from_file (topology_data); |
225 | else | 194 | else |