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