Go to the source code of this file.
Data Structures | |
struct | GNUNET_TESTING_NetjailRouter |
Router of a netjail subnet. More... | |
struct | GNUNET_TESTING_AddressPrefix |
Protocol address prefix für a connection between nodes. More... | |
struct | GNUNET_TESTING_NodeConnection |
Connection to another node. More... | |
struct | GNUNET_TESTING_NetjailNode |
Node in the netjail topology. More... | |
struct | GNUNET_TESTING_NetjailNamespace |
Subnet in a topology. More... | |
struct | GNUNET_TESTING_NetjailTopology |
Toplogy of our netjail setup. More... | |
struct | GNUNET_TESTING_BlockState |
Struct with information for callbacks. More... | |
struct | GNUNET_TESTING_LocalPreparedState |
Struct to hold information for callbacks. More... | |
Macros | |
#define | GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS(op) |
Call op on all simple traits. More... | |
Enumerations | |
enum | GNUNET_TESTING_NodeType { GNUNET_TESTING_SUBNET_NODE , GNUNET_TESTING_GLOBAL_NODE } |
Enum for the different types of nodes. More... | |
#define GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS | ( | op | ) |
Call op on all simple traits.
Definition at line 516 of file gnunet_testing_netjail_lib.h.
Enum for the different types of nodes.
Enumerator | |
---|---|
GNUNET_TESTING_SUBNET_NODE | Node in a subnet. |
GNUNET_TESTING_GLOBAL_NODE | Global known node. |
Definition at line 55 of file gnunet_testing_netjail_lib.h.
struct GNUNET_TESTING_NetjailTopology* GNUNET_TESTING_get_topo_from_file | ( | const char * | filename | ) |
Getting the topology from file.
filename | The name of the topology file. |
Definition at line 2786 of file testing.c.
References _, data, filename, fs, GNUNET_DISK_file_size(), GNUNET_DISK_file_test(), GNUNET_DISK_fn_read(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_malloc, GNUNET_OK, GNUNET_TESTING_get_topo_from_string(), GNUNET_YES, and LOG.
struct GNUNET_TESTING_NetjailTopology* GNUNET_TESTING_get_topo_from_string | ( | const char * | input | ) |
FIXME: this could use a "to_string".
Parse the topology data.
data | The topology data. |
FIXME: this could use a "to_string".
data | The topology data. |
Definition at line 2515 of file testing.c.
References GNUNET_TESTING_NetjailTopology::additional_connects, data, get_first_string_value(), get_first_value(), get_key(), get_second_value(), get_value(), GNUNET_break, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE, GNUNET_CONTAINER_multishortmap_contains(), GNUNET_CONTAINER_multishortmap_create(), GNUNET_CONTAINER_multishortmap_get(), GNUNET_CONTAINER_multishortmap_put(), GNUNET_CRYPTO_hash(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_new, GNUNET_NO, GNUNET_strdup, GNUNET_YES, GNUNET_TESTING_NetjailNode::is_global, key, LOG, GNUNET_TESTING_NetjailTopology::map_globals, GNUNET_TESTING_NetjailTopology::map_namespaces, GNUNET_TESTING_NetjailNode::namespace_n, GNUNET_TESTING_NetjailTopology::namespaces_n, node_connections(), GNUNET_TESTING_NetjailNode::node_n, GNUNET_TESTING_NetjailTopology::nodes_m, GNUNET_TESTING_NetjailTopology::nodes_x, parse_ac(), GNUNET_TESTING_NetjailNode::plugin, GNUNET_TESTING_NetjailTopology::plugin, ret, GNUNET_TESTING_NetjailRouter::tcp_port, GNUNET_TESTING_NetjailRouter::udp_port, and value.
Referenced by GNUNET_TESTING_get_topo_from_file().
unsigned int GNUNET_TESTING_get_additional_connects | ( | unsigned int | num, |
struct GNUNET_TESTING_NetjailTopology * | topology | ||
) |
Get the number of unintentional additional connections the node waits for.
num | The specific node we want the additional connects for. |
Definition at line 2447 of file testing.c.
References GNUNET_TESTING_NetjailNode::additional_connects, get_node_info(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_WARNING, LOG, node_connections(), and topology.
struct GNUNET_TESTING_NetjailNode* GNUNET_TESTING_get_node | ( | unsigned int | num, |
struct GNUNET_TESTING_NetjailTopology * | topology | ||
) |
Get a node from the topology.
num | The specific node we want the connections for. |
topology | The topology we get the connections from. |
Definition at line 2229 of file testing.c.
References get_node_info(), GNUNET_TESTING_NodeConnection::node, node_connections(), and topology.
struct GNUNET_TESTING_NodeConnection* GNUNET_TESTING_get_connections | ( | unsigned int | num, |
const struct GNUNET_TESTING_NetjailTopology * | topology | ||
) |
Get the connections to other nodes for a specific node.
num | The specific node we want the connections for. |
topology | The topology we get the connections from. |
Definition at line 2251 of file testing.c.
References get_node_info(), GNUNET_ERROR_TYPE_DEBUG, LOG, GNUNET_TESTING_NodeConnection::node, node_connections(), and topology.
Referenced by backchannel_check_run(), and connect_peers_run().
char* GNUNET_TESTING_get_address | ( | struct GNUNET_TESTING_NodeConnection * | connection, |
const char * | prefix | ||
) |
Get the address for a specific communicator from a connection.
connection | The connection we like to have the address from. |
prefix | The communicator protocol prefix. |
Definition at line 2387 of file testing.c.
References CONNECT_ADDRESS_TEMPLATE, GNUNET_asprintf(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, KNOWN_CONNECT_ADDRESS_TEMPLATE, LOG, GNUNET_TESTING_NodeConnection::namespace_n, GNUNET_TESTING_NetjailNode::namespace_n, GNUNET_TESTING_NodeConnection::node, GNUNET_TESTING_NodeConnection::node_n, GNUNET_TESTING_NetjailNode::node_n, prefix, PREFIX_TCP, PREFIX_TCP_NATTED, PREFIX_UDP, PREFIX_UDP_NATTED, and ROUTER_CONNECT_ADDRESS_TEMPLATE.
Referenced by connect_peers_run().
void GNUNET_TESTING_free_topology | ( | struct GNUNET_TESTING_NetjailTopology * | topology | ) |
Deallocate memory of the struct GNUNET_TESTING_NetjailTopology.
topology | The GNUNET_TESTING_NetjailTopology to be deallocated. |
Definition at line 2347 of file testing.c.
References free_namespaces_cb(), free_nodes_cb(), GNUNET_CONTAINER_multishortmap_destroy(), GNUNET_CONTAINER_multishortmap_iterate(), GNUNET_free, and topology.
unsigned int GNUNET_TESTING_calculate_num | ( | struct GNUNET_TESTING_NodeConnection * | node_connection, |
struct GNUNET_TESTING_NetjailTopology * | topology | ||
) |
Calculate the unique id identifying a node from a given connection.
node_connection | The connection we calculate the id from. |
topology | The topology we get all needed information from. |
Definition at line 2361 of file testing.c.
References m, GNUNET_TESTING_NodeConnection::namespace_n, GNUNET_TESTING_NodeConnection::node_n, and topology.
Referenced by connect_peers_run(), and notify_connect().
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_system_destroy | ( | const char * | label, |
const char * | create_label | ||
) |
This command destroys the ressources allocated for the test system setup.
label | Name for command. |
create_label | Label of the cmd which started the test system. |
write_message | Callback to write messages to the master loop. |
This command destroys the ressources allocated for the test system setup.
label | name for command. |
create_label | Label of the cmd which started the test system. |
Definition at line 71 of file testing_api_cmd_system_destroy.c.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_system_create | ( | const char * | label, |
const char * | testdir | ||
) |
This command is setting up a test environment for a peer to start.
label | Name for command. |
testdir | Only the directory name without any path. Temporary directory used for all service homes. |
This command is setting up a test environment for a peer to start.
label | name for command. |
label | name for the test environment directory. |
Definition at line 97 of file testing_api_cmd_system_create.c.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_start | ( | const char * | label, |
char * | topology_config, | ||
unsigned int * | read_file | ||
) |
This command executes a shell script to setup the netjail environment.
label | name for command. |
topology_config | Configuration file for the test topology. |
read_file | Flag indicating if the the name of the topology file is send to the helper, or a string with the topology data. |
This command executes a shell script to setup the netjail environment.
label | name for command. |
topology_config | Configuration file for the test topology. |
Definition at line 138 of file testing_api_cmd_netjail_start.c.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_stop | ( | const char * | label, |
char * | topology_config, | ||
unsigned int * | read_file | ||
) |
This command executes a shell script to remove the netjail environment.
label | name for command. |
topology_config | Configuration file for the test topology. |
read_file | Flag indicating if the the name of the topology file is send to the helper, or a string with the topology data. |
Definition at line 128 of file testing_api_cmd_netjail_stop.c.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_netjail_start_cmds_helper | ( | const char * | label, |
struct GNUNET_TESTING_NetjailTopology * | topology, | ||
unsigned int * | read_file, | ||
char * | topology_data, | ||
struct GNUNET_TIME_Relative | timeout | ||
) |
This command executes a shell script which starts a helper process.
This process is running on a netjail node, executing a defined test case.
label | Name for the command. |
topology | The complete topology information. |
read_file | Flag indicating if the the name of the topology file is send to the helper, or a string with the topology data. |
topology_data | If read_file is GNUNET_NO, topology_data holds the string with the topology. |
timeout | Before this timeout is reached this cmd MUST finish. |
This command executes a shell script which starts a helper process.
label | Name for the command. |
topology | The complete topology information. |
read_file | Flag indicating if the the name of the topology file is send to the helper, or a string with the topology data. |
topology_data | If read_file is GNUNET_NO, topology_data holds the string with the topology. |
timeout | Before this timeout is reached this cmd MUST finish. |
Definition at line 839 of file testing_api_cmd_netjail_start_cmds_helper.c.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_stop_cmds_helper | ( | const char * | label, |
const char * | helper_start_label, | ||
struct GNUNET_TESTING_NetjailTopology * | topology | ||
) |
Create command.
label | name for command. |
helper_start_label | label of the cmd to start the test system. |
topology | The complete topology information. |
Definition at line 87 of file testing_api_cmd_netjail_stop_cmds_helper.c.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_block_until_external_trigger | ( | const char * | label | ) |
This command is used to block the loop, until the command is finished by other commands, using a trait to get this commands struct GNUNET_TESTING_AsyncContext.
label | name for command. |
This command is used to block the loop, until the command is finished by other commands, using a trait to get this commands struct GNUNET_TESTING_AsyncContext.
label | name for command. |
Definition at line 78 of file testing_api_cmd_block_until_external_trigger.c.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_send_peer_ready | ( | const char * | label, |
GNUNET_TESTING_cmd_helper_write_cb | write_message | ||
) |
DEPRECATED This command sends a GNUNET_MESSAGE_TYPE_CMDS_HELPER_PEER_STARTED message to the master loop.
label | name for command. |
write_message | Callback to write messages to the master loop. |
DEPRECATED This command sends a GNUNET_MESSAGE_TYPE_CMDS_HELPER_PEER_STARTED message to the master loop.
label | name for command. |
write_message | Callback to write messages to the master loop. |
Definition at line 87 of file testing_api_cmd_send_peer_ready.c.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_local_test_prepared | ( | const char * | label, |
GNUNET_TESTING_cmd_helper_write_cb | write_message | ||
) |
This command sends a GNUNET_MESSAGE_TYPE_CMDS_HELPER_LOCAL_TESTS_PREPARED message to the master loop.
label | name for command. |
write_message | Callback to write messages to the master loop. |
Definition at line 80 of file testing_api_cmd_local_test_prepared.c.
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_test_system | ( | const struct GNUNET_TESTING_Command * | cmd, |
const struct GNUNET_TESTING_System ** | ret | ||
) |
Referenced by backchannel_check_run(), connect_peers_run(), send_simple_run(), start_peer_run(), and system_destroy_run().
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_test_system | ( | const struct GNUNET_TESTING_System * | value | ) |
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_async_context | ( | const struct GNUNET_TESTING_Command * | cmd, |
struct GNUNET_TESTING_AsyncContext ** | ret | ||
) |
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_async_context | ( | struct GNUNET_TESTING_AsyncContext * | value | ) |
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_helper_handles | ( | const struct GNUNET_TESTING_Command * | cmd, |
const struct GNUNET_HELPER_Handle *** | ret | ||
) |
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_helper_handles | ( | const struct GNUNET_HELPER_Handle ** | value | ) |
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_local_prepared_state | ( | const struct GNUNET_TESTING_Command * | cmd, |
const struct GNUNET_TESTING_LocalPreparedState ** | ret | ||
) |
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_local_prepared_state | ( | const struct GNUNET_TESTING_LocalPreparedState * | value | ) |
enum GNUNET_GenericReturnValue GNUNET_TESTING_get_trait_block_state | ( | const struct GNUNET_TESTING_Command * | cmd, |
struct GNUNET_TESTING_BlockState ** | ret | ||
) |
struct GNUNET_TESTING_Trait GNUNET_TESTING_make_trait_block_state | ( | struct GNUNET_TESTING_BlockState * | value | ) |