diff options
Diffstat (limited to 'src/include/gnunet_testing_ng_lib.h')
-rw-r--r-- | src/include/gnunet_testing_ng_lib.h | 68 |
1 files changed, 67 insertions, 1 deletions
diff --git a/src/include/gnunet_testing_ng_lib.h b/src/include/gnunet_testing_ng_lib.h index 44e88f4b1..db89e1a8e 100644 --- a/src/include/gnunet_testing_ng_lib.h +++ b/src/include/gnunet_testing_ng_lib.h | |||
@@ -195,6 +195,16 @@ struct GNUNET_TESTING_Command | |||
195 | struct GNUNET_TIME_Relative default_timeout; | 195 | struct GNUNET_TIME_Relative default_timeout; |
196 | 196 | ||
197 | /** | 197 | /** |
198 | * Pointer to the previous command in the DLL. | ||
199 | */ | ||
200 | struct GNUNET_TESTING_Command *prev; | ||
201 | |||
202 | /** | ||
203 | * Pointer to the next command in the DLL. | ||
204 | */ | ||
205 | struct GNUNET_TESTING_Command *next; | ||
206 | |||
207 | /** | ||
198 | * How often did we try to execute this command? (In case it is a request | 208 | * How often did we try to execute this command? (In case it is a request |
199 | * that is repated.) Note that a command must have some built-in retry | 209 | * that is repated.) Note that a command must have some built-in retry |
200 | * mechanism for this value to be useful. | 210 | * mechanism for this value to be useful. |
@@ -363,8 +373,9 @@ typedef void | |||
363 | * @param timeout how long to wait for each command to execute | 373 | * @param timeout how long to wait for each command to execute |
364 | * @param rc function to call with the final result | 374 | * @param rc function to call with the final result |
365 | * @param rc_cls closure for @a rc | 375 | * @param rc_cls closure for @a rc |
376 | * @return The interpreter. | ||
366 | */ | 377 | */ |
367 | void | 378 | struct GNUNET_TESTING_Interpreter * |
368 | GNUNET_TESTING_run (struct GNUNET_TESTING_Command *commands, | 379 | GNUNET_TESTING_run (struct GNUNET_TESTING_Command *commands, |
369 | struct GNUNET_TIME_Relative timeout, | 380 | struct GNUNET_TIME_Relative timeout, |
370 | GNUNET_TESTING_ResultCallback rc, | 381 | GNUNET_TESTING_ResultCallback rc, |
@@ -397,11 +408,66 @@ int | |||
397 | GNUNET_TESTING_has_in_name (const char *prog, | 408 | GNUNET_TESTING_has_in_name (const char *prog, |
398 | const char *marker); | 409 | const char *marker); |
399 | 410 | ||
411 | /** | ||
412 | * Deleting all barriers create in the context of this interpreter. | ||
413 | * | ||
414 | * @param is The interpreter. | ||
415 | */ | ||
416 | void | ||
417 | GNUNET_TESTING_delete_barriers (struct GNUNET_TESTING_Interpreter *is); | ||
418 | |||
419 | |||
420 | /** | ||
421 | * Getting a barrier from the interpreter. | ||
422 | * | ||
423 | * @param is The interpreter. | ||
424 | * @param barrier_name The name of the barrier. | ||
425 | * @return The barrier. | ||
426 | */ | ||
427 | struct GNUNET_TESTING_Barrier * | ||
428 | GNUNET_TESTING_get_barrier (struct GNUNET_TESTING_Interpreter *is, | ||
429 | const char *barrier_name); | ||
430 | |||
431 | |||
432 | /** | ||
433 | * Add a barrier to the loop. | ||
434 | * | ||
435 | * @param is The interpreter. | ||
436 | * @param barrier The barrier to add. | ||
437 | */ | ||
438 | void | ||
439 | GNUNET_TESTING_barrier_add (struct GNUNET_TESTING_Interpreter *is, | ||
440 | struct GNUNET_TESTING_Barrier *barrier); | ||
441 | |||
400 | 442 | ||
401 | /* ************** Specific interpreter commands ************ */ | 443 | /* ************** Specific interpreter commands ************ */ |
402 | 444 | ||
403 | 445 | ||
404 | /** | 446 | /** |
447 | * Adding a helper handle to the interpreter. | ||
448 | * | ||
449 | * @param is The interpreter. | ||
450 | * @param helper The helper handle. | ||
451 | */ | ||
452 | void | ||
453 | GNUNET_TESTING_add_netjail_helper (struct GNUNET_TESTING_Interpreter *is, | ||
454 | const struct GNUNET_HELPER_Handle *helper); | ||
455 | |||
456 | |||
457 | /** | ||
458 | * Send Message to netjail nodes that a barrier can be advanced. | ||
459 | * | ||
460 | * @param is The interpreter. | ||
461 | * @param global_node_number The node to inform. | ||
462 | * @param header The message to send. | ||
463 | */ | ||
464 | void | ||
465 | GNUNET_TESTING_send_message_to_netjail (struct GNUNET_TESTING_Interpreter *is, | ||
466 | unsigned int global_node_number, | ||
467 | struct GNUNET_MessageHeader *header); | ||
468 | |||
469 | |||
470 | /** | ||
405 | * Returns the actual running command. | 471 | * Returns the actual running command. |
406 | * | 472 | * |
407 | * @param is Global state of the interpreter, used by a command | 473 | * @param is Global state of the interpreter, used by a command |