#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 | TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) |
#define | ROUTER_BASE_IP "92.68.150." |
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 | all_peers_started () |
Callback to set the flag indicating all peers started. More... | |
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 void | all_local_tests_prepared () |
Callback to set the flag indicating all peers are prepared to finish. More... | |
static void | child_completed_callback (void *cls, enum GNUNET_OS_ProcessStatusType type, long unsigned int exit_code) |
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_mapping_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_test_transport_plugin_cmd_nat_mapping_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_mapping.c.
#define BASE_DIR "testdir" |
Definition at line 40 of file plugin_testing_transport_nat_mapping.c.
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) |
Definition at line 42 of file plugin_testing_transport_nat_mapping.c.
#define ROUTER_BASE_IP "92.68.150." |
Definition at line 44 of file plugin_testing_transport_nat_mapping.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_mapping.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_mapping.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_mapping.c.
References GNUNET_new.
Referenced by libgnunet_test_transport_plugin_cmd_nat_mapping_init().
|
static |
Callback to set the flag indicating all peers started.
Will be called via the plugin api.
Definition at line 103 of file plugin_testing_transport_nat_mapping.c.
References block_send, GNUNET_assert, GNUNET_TESTING_async_fail(), and GNUNET_TESTING_async_finish().
Referenced by libgnunet_test_transport_plugin_cmd_nat_mapping_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 124 of file plugin_testing_transport_nat_mapping.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 146 of file plugin_testing_transport_nat_mapping.c.
References GNUNET_TESTING_interpreter_lookup_command(), is, ConnectPeersState::notify_connect, and ret.
Referenced by start_testcase().
|
static |
Callback to set the flag indicating all peers are prepared to finish.
Will be called via the plugin api.
Definition at line 168 of file plugin_testing_transport_nat_mapping.c.
References GNUNET_assert, GNUNET_TESTING_async_fail(), GNUNET_TESTING_async_finish(), and local_prepared.
Referenced by libgnunet_test_transport_plugin_cmd_nat_mapping_init().
|
static |
Definition at line 184 of file plugin_testing_transport_nat_mapping.c.
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. |
Definition at line 203 of file plugin_testing_transport_nat_mapping.c.
References BASE_DIR, block_receive, block_send, TestState::cfgname, child_completed_callback(), commands, connect_peers, finished_cb(), GNUNET_array_append, GNUNET_asprintf(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log_strerror, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_new, GNUNET_NO, GNUNET_TESTING_cmd_end(), GNUNET_TESTING_run(), GNUNET_TRANSPORT_cmd_connect_peers(), 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(), ROUTER_BASE_IP, TestState::testdir, TIMEOUT, TestState::topology, and write_message().
Referenced by libgnunet_test_transport_plugin_cmd_nat_mapping_init().
void * libgnunet_test_transport_plugin_cmd_nat_mapping_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | NULL |
Definition at line 386 of file plugin_testing_transport_nat_mapping.c.
References all_local_tests_prepared(), all_peers_started(), get_waiting_for_barriers(), GNUNET_log_setup(), GNUNET_new, start_testcase(), and GNUNET_TESTING_PluginFunctions::start_testcase.
void * libgnunet_test_transport_plugin_cmd_nat_mapping_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | the return value from libgnunet_test_transport_plugin_cmd_nat_mapping_done |
Definition at line 410 of file plugin_testing_transport_nat_mapping.c.
References GNUNET_TESTING_PluginFunctions::cls, and GNUNET_free.
|
static |
Definition at line 46 of file plugin_testing_transport_nat_mapping.c.
Referenced by all_peers_started(), and start_testcase().
|
static |
Definition at line 48 of file plugin_testing_transport_nat_mapping.c.
Referenced by handle_test(), and start_testcase().
|
static |
Definition at line 50 of file plugin_testing_transport_nat_mapping.c.
Referenced by start_testcase().
|
static |
Definition at line 52 of file plugin_testing_transport_nat_mapping.c.
Referenced by all_local_tests_prepared(), and start_testcase().
|
static |
Definition at line 54 of file plugin_testing_transport_nat_mapping.c.
Referenced by notify_connect(), and start_testcase().