Go to the source code of this file.
Data Structures | |
struct | CommandBarrierCrossable |
Message send to a child loop to inform the child loop about a barrier being advanced. More... | |
struct | CommandBarrierAttached |
Message send by a child loop to inform the master loop how much GNUNET_CMDS_BARRIER_REACHED messages the child will send. More... | |
struct | GNUNET_TESTING_CommandBarrierReached |
struct | TestcasePlugin |
Handle for a plugin. More... | |
struct | CommandListEntry |
struct | GNUNET_TESTING_Barrier |
Functions | |
bool | GNUNET_TESTING_cmd_batch_next_ (void *cls) |
Advance internal pointer to next command. More... | |
bool | GNUNET_TESTING_cmd_is_batch_ (const struct GNUNET_TESTING_Command *cmd) |
Test if this command is a batch command. More... | |
struct GNUNET_TESTING_Command * | GNUNET_TESTING_cmd_batch_get_current_ (const struct GNUNET_TESTING_Command *cmd) |
Obtain what command the batch is at. More... | |
void | GNUNET_TESTING_cmd_batch_set_current_ (const struct GNUNET_TESTING_Command *cmd, unsigned int new_ip) |
Set what command the batch should be at. More... | |
unsigned int | GNUNET_TESTING_barrier_crossable (struct GNUNET_TESTING_Barrier *barrier) |
This function checks, if a barrier can be crossed, which actually means that the cmd representing the barrier is finished. More... | |
void | TST_interpreter_send_barrier_crossable (struct GNUNET_TESTING_Interpreter *is, const char *barrier_name, unsigned int global_node_number) |
Send Message to a netjail node that a barrier can be crossed. More... | |
void | TST_interpreter_finish_attached_cmds (struct GNUNET_TESTING_Interpreter *is, const char *barrier_name) |
Finish all "barrier reached" comands attached to this barrier. More... | |
void | GNUNET_TESTING_send_barrier_attach (struct GNUNET_TESTING_Interpreter *is, char *barrier_name, unsigned int global_node_number, unsigned int expected_reaches, GNUNET_TESTING_cmd_helper_write_cb write_message) |
Send Message to master loop that cmds being attached to a barrier. More... | |
struct GNUNET_TESTING_NetjailNode * | GNUNET_TESTING_barrier_get_node (struct GNUNET_TESTING_Barrier *barrier, unsigned int node_number) |
Getting a node from a map by global node number. More... | |
struct GNUNET_TESTING_Barrier * | TST_interpreter_get_barrier (struct GNUNET_TESTING_Interpreter *is, const char *barrier_name) |
Getting a barrier from the interpreter. More... | |
void | TST_interpreter_add_barrier (struct GNUNET_TESTING_Interpreter *is, struct GNUNET_TESTING_Barrier *barrier) |
Add a barrier to the loop. More... | |
bool GNUNET_TESTING_cmd_batch_next_ | ( | void * | cls | ) |
Advance internal pointer to next command.
cls | batch internal state |
Definition at line 181 of file testing_api_cmd_batch.c.
References BatchState::batch, BatchState::batch_ip, GNUNET_TESTING_Command::finish_time, GNUNET_TIME_absolute_get(), and GNUNET_TESTING_Command::run.
Referenced by interpreter_next().
bool GNUNET_TESTING_cmd_is_batch_ | ( | const struct GNUNET_TESTING_Command * | cmd | ) |
Test if this command is a batch command.
Definition at line 195 of file testing_api_cmd_batch.c.
References batch_run(), and GNUNET_TESTING_Command::run.
Referenced by get_command(), GNUNET_TESTING_cmd_batch_get_current_(), GNUNET_TESTING_cmd_batch_set_current_(), GNUNET_TESTING_interpreter_fail(), and interpreter_next().
struct GNUNET_TESTING_Command* GNUNET_TESTING_cmd_batch_get_current_ | ( | const struct GNUNET_TESTING_Command * | cmd | ) |
Obtain what command the batch is at.
Definition at line 202 of file testing_api_cmd_batch.c.
References BatchState::batch, BatchState::batch_ip, GNUNET_TESTING_Command::cls, GNUNET_assert, and GNUNET_TESTING_cmd_is_batch_().
Referenced by get_command(), and GNUNET_TESTING_interpreter_fail().
void GNUNET_TESTING_cmd_batch_set_current_ | ( | const struct GNUNET_TESTING_Command * | cmd, |
unsigned int | new_ip | ||
) |
Set what command the batch should be at.
Needed for loops. We may want to change this to take a label and/or expose it in the public API in the future. Not used for now.
cmd | current batch command |
new_ip | where to move the IP |
Definition at line 212 of file testing_api_cmd_batch.c.
References BatchState::batch, BatchState::batch_ip, GNUNET_TESTING_Command::cls, GNUNET_assert, GNUNET_TESTING_cmd_is_batch_(), and GNUNET_TESTING_Command::label.
unsigned int GNUNET_TESTING_barrier_crossable | ( | struct GNUNET_TESTING_Barrier * | barrier | ) |
This function checks, if a barrier can be crossed, which actually means that the cmd representing the barrier is finished.
barrier | The barrier in question. |
Definition at line 78 of file testing_api_cmd_barrier.c.
Referenced by barrier_reached(), and barrier_reached_run().
void TST_interpreter_send_barrier_crossable | ( | struct GNUNET_TESTING_Interpreter * | is, |
const char * | barrier_name, | ||
unsigned int | global_node_number | ||
) |
Send Message to a netjail node that a barrier can be crossed.
is | The interpreter loop. |
barrier_name | The name of the barrier to cross. |
global_node_number | The global number of the node to inform. |
Definition at line 762 of file testing_api_loop.c.
References GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_malloc, GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_CROSSABLE, CommandBarrierCrossable::header, is, send_message_to_netjail(), GNUNET_MessageHeader::size, and GNUNET_MessageHeader::type.
Referenced by free_barrier_node_cb().
void TST_interpreter_finish_attached_cmds | ( | struct GNUNET_TESTING_Interpreter * | is, |
const char * | barrier_name | ||
) |
Finish all "barrier reached" comands attached to this barrier.
barrier | The barrier in question. |
Definition at line 816 of file testing_api_loop.c.
References GNUNET_TESTING_Command::ac, GNUNET_TESTING_Command::asynchronous_finish, FreeBarrierNodeCbCls::barrier, GNUNET_TESTING_Barrier::cmds_head, GNUNET_TESTING_Barrier::cmds_tail, CommandListEntry::command, GNUNET_TESTING_AsyncContext::finished, free_barrier_node_cb(), GNUNET_CONTAINER_DLL_remove, GNUNET_CONTAINER_multishortmap_destroy(), GNUNET_CONTAINER_multishortmap_iterate(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_NO, GNUNET_TESTING_async_finish(), GNUNET_YES, is, GNUNET_TESTING_Command::label, GNUNET_TESTING_Barrier::nodes, and TST_interpreter_get_barrier().
Referenced by barrier_reached(), and barrier_reached_run().
void GNUNET_TESTING_send_barrier_attach | ( | struct GNUNET_TESTING_Interpreter * | is, |
char * | barrier_name, | ||
unsigned int | global_node_number, | ||
unsigned int | expected_reaches, | ||
GNUNET_TESTING_cmd_helper_write_cb | write_message | ||
) |
Send Message to master loop that cmds being attached to a barrier.
FIXME: Unused function
is | The interpreter loop. |
barrier_name | The name of the barrier to attach to. |
subnet_number | The number of the subnet. |
node_number | The node to inform. |
write_message | Callback to write messages to the master loop. |
Definition at line 53 of file testing_api_cmd_barrier.c.
References CommandBarrierAttached::expected_reaches, GNUNET_free, GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_ATTACHED, GNUNET_new, CommandBarrierAttached::header, CommandBarrierAttached::node_number, GNUNET_MessageHeader::size, GNUNET_MessageHeader::type, and write_message().
struct GNUNET_TESTING_NetjailNode* GNUNET_TESTING_barrier_get_node | ( | struct GNUNET_TESTING_Barrier * | barrier, |
unsigned int | node_number | ||
) |
Getting a node from a map by global node number.
FIXME: This is a barrier helper function not related to a command but it is implemented in the *_cmd_barrier.c file. Maybe move into a separate file like testing_barrier.c; see also can barrier advance above
nodes | The map. |
node_number | The global node number. |
Definition at line 166 of file testing_api_cmd_barrier.c.
References GNUNET_CONTAINER_multishortmap_get(), GNUNET_CRYPTO_hash(), key, and GNUNET_TESTING_Barrier::nodes.
Referenced by barrier_attached().
struct GNUNET_TESTING_Barrier* TST_interpreter_get_barrier | ( | struct GNUNET_TESTING_Interpreter * | is, |
const char * | barrier_name | ||
) |
Getting a barrier from the interpreter.
is | The interpreter. |
barrier_name | The name of the barrier. |
Definition at line 794 of file testing_api_loop.c.
References GNUNET_TESTING_Interpreter::barriers, GNUNET_CONTAINER_multishortmap_get(), GNUNET_CRYPTO_hash(), and is.
Referenced by barrier_attached(), barrier_reached(), barrier_reached_run(), start_helper(), and TST_interpreter_finish_attached_cmds().
void TST_interpreter_add_barrier | ( | struct GNUNET_TESTING_Interpreter * | is, |
struct GNUNET_TESTING_Barrier * | barrier | ||
) |
Add a barrier to the loop.
is | The interpreter. |
barrier | The barrier to add. |
Definition at line 877 of file testing_api_loop.c.
References GNUNET_TESTING_Interpreter::barriers, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY, GNUNET_CONTAINER_multishortmap_put(), GNUNET_CRYPTO_hash(), is, and GNUNET_TESTING_Barrier::name.
Referenced by barrier_reached_run(), barrier_run(), and start_helper().