#include "platform.h"
#include "gnunet_testing_barrier.h"
#include "gnunet_testing_netjail_lib.h"
#include "gnunet_util_lib.h"
#include "gnunet_transport_application_service.h"
#include "transport-testing2.h"
#include "transport-testing-cmds.h"
Go to the source code of this file.
Macros | |
#define | LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut. More... | |
#define | BASE_DIR "testdir" |
#define | TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" |
#define | TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) |
Functions | |
static int | check_test (void *cls, const struct GNUNET_TRANSPORT_TESTING_TestMessage *message) |
Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being received. More... | |
static void | handle_test (void *cls, const struct GNUNET_TRANSPORT_TESTING_TestMessage *message) |
Function called to handle a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being received. More... | |
struct GNUNET_TESTING_BarrierList * | get_waiting_for_barriers () |
static void | handle_result (void *cls, enum GNUNET_GenericReturnValue rv) |
Function called with the final result of the test. More... | |
static void * | notify_connect (struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer) |
Callback from start peer cmd for signaling a peer got connected. More... | |
static struct GNUNET_TESTING_Interpreter * | start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, const char *router_ip, const char *node_ip, const char *m, const char *n, const char *local_m, const char *topology_data, unsigned int *read_file, GNUNET_TESTING_cmd_helper_finish_cb finished_cb) |
Function to start a local test case. More... | |
void * | libgnunet_test_transport_plugin_cmd_nat_upnp_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_test_transport_plugin_cmd_nat_upnp_done (void *cls) |
Exit point from the plugin. More... | |
Variables | |
static struct GNUNET_TESTING_Command | block_send |
static struct GNUNET_TESTING_Command | block_receive |
static struct GNUNET_TESTING_Command | connect_peers |
static struct GNUNET_TESTING_Command | local_prepared |
static struct GNUNET_TESTING_Interpreter * | is |
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut.
Definition at line 38 of file plugin_testing_transport_nat_upnp.c.
#define BASE_DIR "testdir" |
Definition at line 40 of file plugin_testing_transport_nat_upnp.c.
#define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" |
Definition at line 42 of file plugin_testing_transport_nat_upnp.c.
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) |
Definition at line 44 of file plugin_testing_transport_nat_upnp.c.
|
static |
Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being received.
Definition at line 62 of file plugin_testing_transport_nat_upnp.c.
References GNUNET_OK.
|
static |
Function called to handle a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being received.
Definition at line 75 of file plugin_testing_transport_nat_upnp.c.
References block_receive, GNUNET_assert, GNUNET_TESTING_async_fail(), and GNUNET_TESTING_async_finish().
struct GNUNET_TESTING_BarrierList * get_waiting_for_barriers | ( | ) |
Definition at line 91 of file plugin_testing_transport_nat_upnp.c.
References GNUNET_CONTAINER_DLL_insert, and GNUNET_new.
Referenced by libgnunet_test_transport_plugin_cmd_nat_upnp_init().
|
static |
Function called with the final result of the test.
cls | the struct MainParams |
rv | GNUNET_OK if the test passed |
Definition at line 121 of file plugin_testing_transport_nat_upnp.c.
References TestState::cfgname, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_TESTING_free_topology(), TestState::testdir, and TestState::topology.
Referenced by start_testcase().
|
static |
Callback from start peer cmd for signaling a peer got connected.
Definition at line 143 of file plugin_testing_transport_nat_upnp.c.
References GNUNET_TESTING_interpreter_lookup_command(), is, ConnectPeersState::notify_connect, and ret.
Referenced by start_testcase().
|
static |
Function to start a local test case.
write_message | Callback to send a message to the master loop. |
router_ip | Global address of the network namespace. |
node_ip | The IP address of the node. |
m | The number of the node in a network namespace. |
n | The number of the network namespace. |
local_m | The number of nodes in a network namespace. |
topology_data | A file name for the file containing the topology configuration, or a string containing the topology configuration. |
read_file | If read_file is GNUNET_YES this string is the filename for the topology configuration, if read_file is GNUNET_NO the string contains the topology configuration. |
finish_cb | Callback function which writes a message from the helper process running on a netjail node to the master process * signaling that the test case running on the netjail node finished. |
Definition at line 179 of file plugin_testing_transport_nat_upnp.c.
References BASE_DIR, block_receive, block_send, TestState::cfgname, commands, connect_peers, finished_cb(), GNUNET_asprintf(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log_strerror, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_new, GNUNET_NO, GNUNET_TESTING_cmd_barrier_reached(), GNUNET_TESTING_cmd_end(), GNUNET_TESTING_run(), GNUNET_TRANSPORT_cmd_connect_peers(), GNUNET_TRANSPORT_cmd_send_simple(), GNUNET_TRANSPORT_cmd_start_peer(), GNUNET_TRANSPORT_cmd_stop_peer(), GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE, GNUNET_YES, handle_result(), handlers, is, local_prepared, LOG, m, GNUNET_TESTING_NetjailTopology::nodes_x, notify_connect(), read_file(), TestState::testdir, TIMEOUT, TestState::topology, and write_message().
Referenced by libgnunet_test_transport_plugin_cmd_nat_upnp_init().
void * libgnunet_test_transport_plugin_cmd_nat_upnp_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | NULL |
Definition at line 337 of file plugin_testing_transport_nat_upnp.c.
References get_waiting_for_barriers(), GNUNET_log_setup(), GNUNET_new, start_testcase(), and GNUNET_TESTING_PluginFunctions::start_testcase.
void * libgnunet_test_transport_plugin_cmd_nat_upnp_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | the return value from #libgnunet_test_transport_plugin_nat_upnp_init |
Definition at line 359 of file plugin_testing_transport_nat_upnp.c.
References GNUNET_TESTING_PluginFunctions::cls, and GNUNET_free.
|
static |
Definition at line 46 of file plugin_testing_transport_nat_upnp.c.
Referenced by start_testcase().
|
static |
Definition at line 48 of file plugin_testing_transport_nat_upnp.c.
Referenced by handle_test(), and start_testcase().
|
static |
Definition at line 50 of file plugin_testing_transport_nat_upnp.c.
Referenced by start_testcase().
|
static |
Definition at line 52 of file plugin_testing_transport_nat_upnp.c.
Referenced by start_testcase().
|
static |
Definition at line 54 of file plugin_testing_transport_nat_upnp.c.
Referenced by notify_connect(), and start_testcase().