diff options
author | t3sserakt <t3ss@posteo.de> | 2021-10-25 14:49:05 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2021-10-25 14:49:05 +0200 |
commit | 1609d627e509043a946f611d7589105cfae2364d (patch) | |
tree | d6022bea17730f96c7d87b0a1c8f602717edb25d /src/testing | |
parent | 513f23e74650db9408267e82ef8bcb8f770d1015 (diff) | |
download | gnunet-1609d627e509043a946f611d7589105cfae2364d.tar.gz gnunet-1609d627e509043a946f611d7589105cfae2364d.zip |
changes to reflect the changes in testing_api_loop.c
Diffstat (limited to 'src/testing')
5 files changed, 183 insertions, 99 deletions
diff --git a/src/testing/testing_api_cmd_local_test_finished.c b/src/testing/testing_api_cmd_local_test_finished.c index 0e7e214dc..8f8a8230c 100644 --- a/src/testing/testing_api_cmd_local_test_finished.c +++ b/src/testing/testing_api_cmd_local_test_finished.c | |||
@@ -64,7 +64,6 @@ local_test_finished_cleanup (void *cls) | |||
64 | { | 64 | { |
65 | struct LocalFinishedState *lfs = cls; | 65 | struct LocalFinishedState *lfs = cls; |
66 | 66 | ||
67 | GNUNET_free (lfs->reply); | ||
68 | GNUNET_free (lfs); | 67 | GNUNET_free (lfs); |
69 | } | 68 | } |
70 | 69 | ||
diff --git a/src/testing/testing_api_cmd_local_test_prepared.c b/src/testing/testing_api_cmd_local_test_prepared.c index 4e915c7c0..2554d6fec 100644 --- a/src/testing/testing_api_cmd_local_test_prepared.c +++ b/src/testing/testing_api_cmd_local_test_prepared.c | |||
@@ -35,41 +35,47 @@ | |||
35 | 35 | ||
36 | 36 | ||
37 | /** | 37 | /** |
38 | * Struct to hold information for callbacks. | 38 | * This function prepares an array with traits. |
39 | * | 39 | * |
40 | */ | 40 | */ |
41 | struct LocalPreparedState | 41 | enum GNUNET_GenericReturnValue |
42 | local_test_prepared_traits (void *cls, | ||
43 | const void **ret, | ||
44 | const char *trait, | ||
45 | unsigned int index) | ||
42 | { | 46 | { |
43 | /** | 47 | struct LocalPreparedState *lfs = cls; |
44 | * Callback to write messages to the master loop. | 48 | struct GNUNET_TESTING_Trait traits[] = { |
45 | * | 49 | { |
46 | */ | 50 | .index = 0, |
47 | TESTING_CMD_HELPER_write_cb write_message; | 51 | .trait_name = "state", |
48 | 52 | .ptr = (const void *) lfs, | |
49 | /** | 53 | }, |
50 | * The message send back to the master loop. | 54 | GNUNET_TESTING_trait_end () |
51 | * | 55 | }; |
52 | */ | 56 | return GNUNET_TESTING_get_trait (traits, |
53 | struct GNUNET_CMDS_LOCAL_TEST_PREPARED *reply; | 57 | ret, |
54 | 58 | trait, | |
55 | /** | 59 | index); |
56 | * Flag indicating if all local tests finished. | 60 | } |
57 | */ | ||
58 | unsigned int *all_local_tests_prepared; | ||
59 | }; | ||
60 | 61 | ||
61 | 62 | ||
62 | /** | 63 | /** |
63 | * Trait function of this cmd does nothing. | 64 | * Function to get the trait with the struct LocalPreparedState. |
65 | * | ||
66 | * @param[out] lfs struct LocalPreparedState. | ||
67 | * @return #GNUNET_OK if no error occurred, #GNUNET_SYSERR otherwise. | ||
64 | * | 68 | * |
65 | */ | 69 | */ |
66 | static int | 70 | enum GNUNET_GenericReturnValue |
67 | local_test_prepared_traits (void *cls, | 71 | GNUNET_TESTING_get_trait_local_prepared_state ( |
68 | const void **ret, | 72 | const struct GNUNET_TESTING_Command *cmd, |
69 | const char *trait, | 73 | struct LocalPreparedState **lfs) |
70 | unsigned int index) | ||
71 | { | 74 | { |
72 | return GNUNET_OK; | 75 | return cmd->traits (cmd->cls, |
76 | (const void **) lfs, | ||
77 | "state", | ||
78 | (unsigned int) 0); | ||
73 | } | 79 | } |
74 | 80 | ||
75 | 81 | ||
@@ -78,12 +84,10 @@ local_test_prepared_traits (void *cls, | |||
78 | * | 84 | * |
79 | */ | 85 | */ |
80 | static void | 86 | static void |
81 | local_test_prepared_cleanup (void *cls, | 87 | local_test_prepared_cleanup (void *cls) |
82 | const struct GNUNET_TESTING_Command *cmd) | ||
83 | { | 88 | { |
84 | struct LocalPreparedState *lfs = cls; | 89 | struct LocalPreparedState *lfs = cls; |
85 | 90 | ||
86 | GNUNET_free (lfs->reply); | ||
87 | GNUNET_free (lfs); | 91 | GNUNET_free (lfs); |
88 | } | 92 | } |
89 | 93 | ||
@@ -94,7 +98,6 @@ local_test_prepared_cleanup (void *cls, | |||
94 | */ | 98 | */ |
95 | static void | 99 | static void |
96 | local_test_prepared_run (void *cls, | 100 | local_test_prepared_run (void *cls, |
97 | const struct GNUNET_TESTING_Command *cmd, | ||
98 | struct GNUNET_TESTING_Interpreter *is) | 101 | struct GNUNET_TESTING_Interpreter *is) |
99 | { | 102 | { |
100 | struct LocalPreparedState *lfs = cls; | 103 | struct LocalPreparedState *lfs = cls; |
@@ -107,34 +110,11 @@ local_test_prepared_run (void *cls, | |||
107 | reply->header.type = htons ( | 110 | reply->header.type = htons ( |
108 | GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_TEST_PREPARED); | 111 | GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_TEST_PREPARED); |
109 | reply->header.size = htons ((uint16_t) msg_length); | 112 | reply->header.size = htons ((uint16_t) msg_length); |
110 | lfs->reply = reply; | ||
111 | lfs->write_message ((struct GNUNET_MessageHeader *) reply, msg_length); | 113 | lfs->write_message ((struct GNUNET_MessageHeader *) reply, msg_length); |
112 | } | 114 | } |
113 | 115 | ||
114 | 116 | ||
115 | /** | 117 | /** |
116 | * This finish function will stop the local loop without shutting down the scheduler, because we do not call the continuation, which is the interpreter_next method. | ||
117 | * | ||
118 | */ | ||
119 | static int | ||
120 | local_test_prepared_finish (void *cls, | ||
121 | GNUNET_SCHEDULER_TaskCallback cont, | ||
122 | void *cont_cls) | ||
123 | { | ||
124 | struct LocalPreparedState *lfs = cls; | ||
125 | unsigned int *ret = lfs->all_local_tests_prepared; | ||
126 | |||
127 | if (GNUNET_YES == *ret) | ||
128 | { | ||
129 | cont (cont_cls); | ||
130 | } | ||
131 | |||
132 | return *ret; | ||
133 | |||
134 | } | ||
135 | |||
136 | |||
137 | /** | ||
138 | * Create command. | 118 | * Create command. |
139 | * | 119 | * |
140 | * @param label name for command. | 120 | * @param label name for command. |
@@ -145,21 +125,18 @@ local_test_prepared_finish (void *cls, | |||
145 | struct GNUNET_TESTING_Command | 125 | struct GNUNET_TESTING_Command |
146 | GNUNET_TESTING_cmd_local_test_prepared (const char *label, | 126 | GNUNET_TESTING_cmd_local_test_prepared (const char *label, |
147 | TESTING_CMD_HELPER_write_cb | 127 | TESTING_CMD_HELPER_write_cb |
148 | write_message, | 128 | write_message) |
149 | unsigned int * | ||
150 | all_local_tests_prepared) | ||
151 | { | 129 | { |
152 | struct LocalPreparedState *lfs; | 130 | struct LocalPreparedState *lfs; |
153 | 131 | ||
154 | lfs = GNUNET_new (struct LocalPreparedState); | 132 | lfs = GNUNET_new (struct LocalPreparedState); |
155 | lfs->write_message = write_message; | 133 | lfs->write_message = write_message; |
156 | lfs->all_local_tests_prepared = all_local_tests_prepared; | ||
157 | 134 | ||
158 | struct GNUNET_TESTING_Command cmd = { | 135 | struct GNUNET_TESTING_Command cmd = { |
159 | .cls = lfs, | 136 | .cls = lfs, |
160 | .label = label, | 137 | .label = label, |
161 | .run = &local_test_prepared_run, | 138 | .run = &local_test_prepared_run, |
162 | .finish = &local_test_prepared_finish, | 139 | .ac = &lfs->ac, |
163 | .cleanup = &local_test_prepared_cleanup, | 140 | .cleanup = &local_test_prepared_cleanup, |
164 | .traits = &local_test_prepared_traits | 141 | .traits = &local_test_prepared_traits |
165 | }; | 142 | }; |
diff --git a/src/testing/testing_api_cmd_netjail_start_testsystem.c b/src/testing/testing_api_cmd_netjail_start_testsystem.c index a1d71c436..9b567a01f 100644 --- a/src/testing/testing_api_cmd_netjail_start_testsystem.c +++ b/src/testing/testing_api_cmd_netjail_start_testsystem.c | |||
@@ -30,6 +30,11 @@ | |||
30 | #define NETJAIL_EXEC_SCRIPT "./../testing/netjail_exec.sh" | 30 | #define NETJAIL_EXEC_SCRIPT "./../testing/netjail_exec.sh" |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * Generic logging shortcut | ||
34 | */ | ||
35 | #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) | ||
36 | |||
37 | /** | ||
33 | * Struct to store messages send/received by the helper into a DLL | 38 | * Struct to store messages send/received by the helper into a DLL |
34 | * | 39 | * |
35 | */ | 40 | */ |
@@ -121,13 +126,13 @@ struct NetJailState | |||
121 | /** | 126 | /** |
122 | * The send handle for the helper | 127 | * The send handle for the helper |
123 | */ | 128 | */ |
124 | struct GNUNET_HELPER_SendHandle **shandle; | 129 | // struct GNUNET_HELPER_SendHandle **shandle; |
125 | 130 | ||
126 | /** | 131 | /** |
127 | * Size of the array NetJailState#shandle. | 132 | * Size of the array NetJailState#shandle. |
128 | * | 133 | * |
129 | */ | 134 | */ |
130 | unsigned int n_shandle; | 135 | // unsigned int n_shandle; |
131 | 136 | ||
132 | /** | 137 | /** |
133 | * The messages send to the helper. | 138 | * The messages send to the helper. |
@@ -156,7 +161,13 @@ struct NetJailState | |||
156 | * Number of local tests finished. | 161 | * Number of local tests finished. |
157 | * | 162 | * |
158 | */ | 163 | */ |
159 | unsigned int number_of_local_test_finished; | 164 | unsigned int number_of_local_tests_finished; |
165 | |||
166 | /** | ||
167 | * Number of local tests prepared to finish. | ||
168 | * | ||
169 | */ | ||
170 | unsigned int number_of_local_tests_prepared; | ||
160 | 171 | ||
161 | /** | 172 | /** |
162 | * Name of the test case plugin the helper will load. | 173 | * Name of the test case plugin the helper will load. |
@@ -194,6 +205,17 @@ struct TestingSystemCount | |||
194 | struct TestingSystemCount *prev; | 205 | struct TestingSystemCount *prev; |
195 | 206 | ||
196 | /** | 207 | /** |
208 | * The send handle for the helper | ||
209 | */ | ||
210 | struct GNUNET_HELPER_SendHandle *shandle;// **shandle; | ||
211 | |||
212 | /** | ||
213 | * Size of the array NetJailState#shandle. | ||
214 | * | ||
215 | */ | ||
216 | // unsigned int n_shandle; | ||
217 | |||
218 | /** | ||
197 | * The number of the test environment. | 219 | * The number of the test environment. |
198 | * | 220 | * |
199 | */ | 221 | */ |
@@ -306,47 +328,85 @@ clear_msg (void *cls, int result) | |||
306 | struct TestingSystemCount *tbc = cls; | 328 | struct TestingSystemCount *tbc = cls; |
307 | struct NetJailState *ns = tbc->ns; | 329 | struct NetJailState *ns = tbc->ns; |
308 | 330 | ||
309 | GNUNET_assert (NULL != ns->shandle[tbc->count - 1]); | 331 | GNUNET_assert (NULL != tbc->shandle);// [tbc->count - 1]); |
310 | ns->shandle[tbc->count - 1] = NULL; | 332 | tbc->shandle = NULL;// [tbc->count - 1] = NULL; |
311 | GNUNET_free (ns->msg[tbc->count - 1]); | 333 | GNUNET_free (ns->msg[tbc->count - 1]); |
312 | ns->msg[tbc->count - 1] = NULL; | 334 | ns->msg[tbc->count - 1] = NULL; |
313 | } | 335 | } |
314 | 336 | ||
315 | 337 | ||
316 | static void | 338 | static void |
317 | send_all_peers_started (unsigned int i, unsigned int j, struct NetJailState *ns) | 339 | send_message_to_locals ( |
340 | unsigned int i, | ||
341 | unsigned int j, | ||
342 | struct NetJailState *ns, | ||
343 | struct GNUNET_MessageHeader *header | ||
344 | ) | ||
318 | { | 345 | { |
319 | unsigned int total_number = ns->local_m * ns->global_n + ns->known; | 346 | // unsigned int total_number = ns->local_m * ns->global_n + ns->known; |
320 | struct GNUNET_CMDS_ALL_PEERS_STARTED *reply; | ||
321 | size_t msg_length; | ||
322 | struct GNUNET_HELPER_Handle *helper; | 347 | struct GNUNET_HELPER_Handle *helper; |
323 | struct TestingSystemCount *tbc; | 348 | struct TestingSystemCount *tbc; |
324 | 349 | ||
350 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
351 | "send message of type %u to locals\n", | ||
352 | header->type); | ||
325 | tbc = GNUNET_new (struct TestingSystemCount); | 353 | tbc = GNUNET_new (struct TestingSystemCount); |
326 | tbc->ns = ns; | 354 | tbc->ns = ns; |
327 | // TODO This needs to be more generic. As we send more messages back and forth, we can not grow the arrays again and again, because this is to error prone. | 355 | // TODO This needs to be more generic. As we send more messages back and forth, we can not grow the arrays again and again, because this is to error prone. |
328 | if (0 == i) | 356 | if (0 == i) |
329 | tbc->count = j + total_number; | 357 | tbc->count = j; // + total_number; |
330 | else | 358 | else |
331 | tbc->count = (i - 1) * ns->local_m + j + total_number + ns->known; | 359 | tbc->count = (i - 1) * ns->local_m + j + ns->known; // + total_number ; |
332 | 360 | ||
333 | helper = ns->helper[tbc->count - 1 - total_number]; | 361 | helper = ns->helper[tbc->count - 1];// - total_number]; |
334 | msg_length = sizeof(struct GNUNET_CMDS_ALL_PEERS_STARTED); | ||
335 | reply = GNUNET_new (struct GNUNET_CMDS_ALL_PEERS_STARTED); | ||
336 | reply->header.type = htons ( | ||
337 | GNUNET_MESSAGE_TYPE_CMDS_HELPER_ALL_PEERS_STARTED); | ||
338 | reply->header.size = htons ((uint16_t) msg_length); | ||
339 | 362 | ||
340 | GNUNET_array_append (ns->msg, ns->n_msg, &reply->header); | 363 | GNUNET_array_append (ns->msg, ns->n_msg, header); |
341 | 364 | ||
342 | struct GNUNET_HELPER_SendHandle *sh = GNUNET_HELPER_send ( | 365 | struct GNUNET_HELPER_SendHandle *sh = GNUNET_HELPER_send ( |
343 | helper, | 366 | helper, |
344 | &reply->header, | 367 | header, |
345 | GNUNET_NO, | 368 | GNUNET_NO, |
346 | &clear_msg, | 369 | &clear_msg, |
347 | tbc); | 370 | tbc); |
348 | 371 | ||
349 | GNUNET_array_append (ns->shandle, ns->n_shandle, sh); | 372 | tbc->shandle = sh; |
373 | // GNUNET_array_append (tbc->shandle, tbc->n_shandle, sh); | ||
374 | } | ||
375 | |||
376 | |||
377 | static void | ||
378 | send_all_local_tests_prepared (unsigned int i, unsigned int j, struct | ||
379 | NetJailState *ns) | ||
380 | { | ||
381 | struct GNUNET_CMDS_ALL_LOCAL_TESTS_PREPARED *reply; | ||
382 | size_t msg_length; | ||
383 | |||
384 | |||
385 | msg_length = sizeof(struct GNUNET_CMDS_ALL_LOCAL_TESTS_PREPARED); | ||
386 | reply = GNUNET_new (struct GNUNET_CMDS_ALL_LOCAL_TESTS_PREPARED); | ||
387 | reply->header.type = htons ( | ||
388 | GNUNET_MESSAGE_TYPE_CMDS_HELPER_ALL_LOCAL_TESTS_PREPARED); | ||
389 | reply->header.size = htons ((uint16_t) msg_length); | ||
390 | |||
391 | send_message_to_locals (i, j, ns, &reply->header); | ||
392 | } | ||
393 | |||
394 | |||
395 | static void | ||
396 | send_all_peers_started (unsigned int i, unsigned int j, struct NetJailState *ns) | ||
397 | { | ||
398 | |||
399 | struct GNUNET_CMDS_ALL_PEERS_STARTED *reply; | ||
400 | size_t msg_length; | ||
401 | |||
402 | |||
403 | msg_length = sizeof(struct GNUNET_CMDS_ALL_PEERS_STARTED); | ||
404 | reply = GNUNET_new (struct GNUNET_CMDS_ALL_PEERS_STARTED); | ||
405 | reply->header.type = htons ( | ||
406 | GNUNET_MESSAGE_TYPE_CMDS_HELPER_ALL_PEERS_STARTED); | ||
407 | reply->header.size = htons ((uint16_t) msg_length); | ||
408 | |||
409 | send_message_to_locals (i, j, ns, &reply->header); | ||
350 | } | 410 | } |
351 | 411 | ||
352 | 412 | ||
@@ -365,11 +425,22 @@ send_all_peers_started (unsigned int i, unsigned int j, struct NetJailState *ns) | |||
365 | static int | 425 | static int |
366 | helper_mst (void *cls, const struct GNUNET_MessageHeader *message) | 426 | helper_mst (void *cls, const struct GNUNET_MessageHeader *message) |
367 | { | 427 | { |
368 | struct TestingSystemCount *tbc = cls; | 428 | // struct TestingSystemCount *tbc = cls; |
369 | struct NetJailState *ns = tbc->ns; | 429 | struct NetJailState *ns = cls;// tbc->ns; |
370 | struct HelperMessage *hp_msg; | 430 | struct HelperMessage *hp_msg; |
371 | unsigned int total_number = ns->local_m * ns->global_n + ns->known; | 431 | unsigned int total_number = ns->local_m * ns->global_n + ns->known; |
372 | 432 | ||
433 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
434 | "total %u sysstarted %u peersstarted %u prep %u finished %u %u %u %u\n", | ||
435 | total_number, | ||
436 | ns->number_of_testsystems_started, | ||
437 | ns->number_of_peers_started, | ||
438 | ns->number_of_local_tests_prepared, | ||
439 | ns->number_of_local_tests_finished, | ||
440 | ns->local_m, | ||
441 | ns->global_n, | ||
442 | ns->known); | ||
443 | |||
373 | if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_REPLY == ntohs (message->type)) | 444 | if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_REPLY == ntohs (message->type)) |
374 | { | 445 | { |
375 | ns->number_of_testsystems_started++; | 446 | ns->number_of_testsystems_started++; |
@@ -395,11 +466,31 @@ helper_mst (void *cls, const struct GNUNET_MessageHeader *message) | |||
395 | ns->number_of_peers_started = 0; | 466 | ns->number_of_peers_started = 0; |
396 | } | 467 | } |
397 | } | 468 | } |
469 | else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_TEST_PREPARED == ntohs ( | ||
470 | message->type)) | ||
471 | { | ||
472 | ns->number_of_local_tests_prepared++; | ||
473 | if (ns->number_of_local_tests_prepared == total_number) | ||
474 | { | ||
475 | for (int i = 1; i <= ns->known; i++) | ||
476 | { | ||
477 | send_all_local_tests_prepared (0,i, ns); | ||
478 | } | ||
479 | |||
480 | for (int i = 1; i <= ns->global_n; i++) | ||
481 | { | ||
482 | for (int j = 1; j <= ns->local_m; j++) | ||
483 | { | ||
484 | send_all_local_tests_prepared (i,j, ns); | ||
485 | } | ||
486 | } | ||
487 | } | ||
488 | } | ||
398 | else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED == ntohs ( | 489 | else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_FINISHED == ntohs ( |
399 | message->type)) | 490 | message->type)) |
400 | { | 491 | { |
401 | ns->number_of_local_test_finished++; | 492 | ns->number_of_local_tests_finished++; |
402 | if (ns->number_of_local_test_finished == total_number) | 493 | if (ns->number_of_local_tests_finished == total_number) |
403 | { | 494 | { |
404 | GNUNET_TESTING_async_finish (&ns->ac); | 495 | GNUNET_TESTING_async_finish (&ns->ac); |
405 | } | 496 | } |
@@ -477,8 +568,13 @@ start_helper (struct NetJailState *ns, struct | |||
477 | struct GNUNET_HELPER_Handle *helper; | 568 | struct GNUNET_HELPER_Handle *helper; |
478 | struct GNUNET_CMDS_HelperInit *msg; | 569 | struct GNUNET_CMDS_HelperInit *msg; |
479 | struct TestingSystemCount *tbc; | 570 | struct TestingSystemCount *tbc; |
480 | char *m_char, *n_char, *global_n_char, *local_m_char, *known_char, *node_id, | 571 | char *m_char; |
481 | *plugin; | 572 | char *n_char; |
573 | char *global_n_char; | ||
574 | char *local_m_char; | ||
575 | char *known_char; | ||
576 | char *node_id; | ||
577 | char *plugin; | ||
482 | pid_t pid; | 578 | pid_t pid; |
483 | unsigned int script_num; | 579 | unsigned int script_num; |
484 | struct GNUNET_ShortHashCode *hkey; | 580 | struct GNUNET_ShortHashCode *hkey; |
@@ -486,6 +582,7 @@ start_helper (struct NetJailState *ns, struct | |||
486 | struct GNUNET_TESTING_NetjailTopology *topology = ns->topology; | 582 | struct GNUNET_TESTING_NetjailTopology *topology = ns->topology; |
487 | struct GNUNET_TESTING_NetjailNode *node; | 583 | struct GNUNET_TESTING_NetjailNode *node; |
488 | struct GNUNET_TESTING_NetjailNamespace *namespace; | 584 | struct GNUNET_TESTING_NetjailNamespace *namespace; |
585 | unsigned int *rv = ns->rv; | ||
489 | 586 | ||
490 | 587 | ||
491 | if (0 == n) | 588 | if (0 == n) |
@@ -526,7 +623,8 @@ start_helper (struct NetJailState *ns, struct | |||
526 | else | 623 | else |
527 | tbc->count = (n - 1) * ns->local_m + m + ns->known; | 624 | tbc->count = (n - 1) * ns->local_m + m + ns->known; |
528 | 625 | ||
529 | GNUNET_CONTAINER_DLL_insert (ns->tbcs_head, ns->tbcs_tail, | 626 | GNUNET_CONTAINER_DLL_insert (ns->tbcs_head, |
627 | ns->tbcs_tail, | ||
530 | tbc); | 628 | tbc); |
531 | 629 | ||
532 | 630 | ||
@@ -535,23 +633,33 @@ start_helper (struct NetJailState *ns, struct | |||
535 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 633 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
536 | "No SUID for %s!\n", | 634 | "No SUID for %s!\n", |
537 | NETJAIL_EXEC_SCRIPT); | 635 | NETJAIL_EXEC_SCRIPT); |
538 | GNUNET_TESTING_interpreter_fail (ns->ac.is); | 636 | *rv = 1; |
539 | } | 637 | } |
540 | else if (GNUNET_NO == helper_check) | 638 | else if (GNUNET_NO == helper_check) |
541 | { | 639 | { |
542 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 640 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
543 | "%s not found!\n", | 641 | "%s not found!\n", |
544 | NETJAIL_EXEC_SCRIPT); | 642 | NETJAIL_EXEC_SCRIPT); |
545 | GNUNET_TESTING_interpreter_fail (ns->ac.is); | 643 | *rv = 1; |
546 | } | 644 | } |
547 | 645 | ||
646 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
647 | "sysstarted %u peersstarted %u prep %u finished %u %u %u %u\n", | ||
648 | ns->number_of_testsystems_started, | ||
649 | ns->number_of_peers_started, | ||
650 | ns->number_of_local_tests_prepared, | ||
651 | ns->number_of_local_tests_finished, | ||
652 | ns->local_m, | ||
653 | ns->global_n, | ||
654 | ns->known); | ||
655 | |||
548 | GNUNET_array_append (ns->helper, ns->n_helper, GNUNET_HELPER_start ( | 656 | GNUNET_array_append (ns->helper, ns->n_helper, GNUNET_HELPER_start ( |
549 | GNUNET_YES, | 657 | GNUNET_YES, |
550 | NETJAIL_EXEC_SCRIPT, | 658 | NETJAIL_EXEC_SCRIPT, |
551 | script_argv, | 659 | script_argv, |
552 | &helper_mst, | 660 | &helper_mst, |
553 | &exp_cb, | 661 | &exp_cb, |
554 | tbc)); | 662 | ns)); |
555 | 663 | ||
556 | helper = ns->helper[tbc->count - 1]; | 664 | helper = ns->helper[tbc->count - 1]; |
557 | 665 | ||
@@ -608,19 +716,20 @@ start_helper (struct NetJailState *ns, struct | |||
608 | 716 | ||
609 | GNUNET_array_append (ns->msg, ns->n_msg, &msg->header); | 717 | GNUNET_array_append (ns->msg, ns->n_msg, &msg->header); |
610 | 718 | ||
611 | GNUNET_array_append (ns->shandle, ns->n_shandle, GNUNET_HELPER_send ( | 719 | // GNUNET_array_append (tbc->shandle, tbc->n_shandle, |
612 | helper, | 720 | tbc->shandle = GNUNET_HELPER_send ( |
613 | &msg->header, | 721 | helper, |
614 | GNUNET_NO, | 722 | &msg->header, |
615 | &clear_msg, | 723 | GNUNET_NO, |
616 | tbc)); | 724 | &clear_msg, |
725 | tbc); // ); | ||
617 | 726 | ||
618 | if (NULL == ns->shandle[tbc->count - 1]) | 727 | if (NULL == tbc->shandle)// [tbc->count - 1]) |
619 | { | 728 | { |
620 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 729 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
621 | "Send handle is NULL!\n"); | 730 | "Send handle is NULL!\n"); |
622 | GNUNET_free (msg); | 731 | GNUNET_free (msg); |
623 | GNUNET_TESTING_interpreter_fail (ns->ac.is); | 732 | *rv = 1; |
624 | } | 733 | } |
625 | } | 734 | } |
626 | 735 | ||
diff --git a/src/testing/testing_api_cmd_netjail_stop_testsystem.c b/src/testing/testing_api_cmd_netjail_stop_testsystem.c index d3754153d..33792f1b0 100644 --- a/src/testing/testing_api_cmd_netjail_stop_testsystem.c +++ b/src/testing/testing_api_cmd_netjail_stop_testsystem.c | |||
@@ -95,7 +95,7 @@ stop_testing_system_run (void *cls, | |||
95 | struct GNUNET_HELPER_Handle **helper; | 95 | struct GNUNET_HELPER_Handle **helper; |
96 | const struct GNUNET_TESTING_Command *start_helper_cmd; | 96 | const struct GNUNET_TESTING_Command *start_helper_cmd; |
97 | 97 | ||
98 | start_helper_cmd = GNUNET_TESTING_interpreter_lookup_command (NULL, | 98 | start_helper_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
99 | shs-> | 99 | shs-> |
100 | helper_start_label); | 100 | helper_start_label); |
101 | GNUNET_TESTING_get_trait_helper_handles (start_helper_cmd, | 101 | GNUNET_TESTING_get_trait_helper_handles (start_helper_cmd, |
diff --git a/src/testing/testing_api_cmd_send_peer_ready.c b/src/testing/testing_api_cmd_send_peer_ready.c index 8b4c11deb..8eef1d8f1 100644 --- a/src/testing/testing_api_cmd_send_peer_ready.c +++ b/src/testing/testing_api_cmd_send_peer_ready.c | |||
@@ -72,7 +72,6 @@ send_peer_ready_cleanup (void *cls) | |||
72 | { | 72 | { |
73 | struct SendPeerReadyState *sprs = cls; | 73 | struct SendPeerReadyState *sprs = cls; |
74 | 74 | ||
75 | GNUNET_free (sprs->reply); | ||
76 | GNUNET_free (sprs); | 75 | GNUNET_free (sprs); |
77 | } | 76 | } |
78 | 77 | ||