#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_from (kind, "udp-backchannel", __VA_ARGS__) |
Generic logging shortcut. More... | |
#define | BASE_DIR "testdir" |
#define | TOPOLOGY_CONFIG "test_transport_udp_backchannel_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 | 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... | |
void * | libgnunet_test_transport_plugin_cmd_udp_backchannel_init (void *cls) |
Entry point for the plugin. More... | |
GNUNET_TESTING_MAKE_PLUGIN (libgnunet, udp_backchannel, GNUNET_TESTING_cmd_system_create("system-create", ts->testdir), GNUNET_TRANSPORT_cmd_start_peer("start-peer", "system-create", num, node_ip, handlers, ts->cfgname, notify_connect, GNUNET_NO), GNUNET_TESTING_cmd_send_peer_ready("send-peer-ready", write_message), block_send, connect_peers, GNUNET_TRANSPORT_cmd_backchannel_check("backchannel-check", "start-peer", "system-create", num, m_int, n_int, topology), local_prepared, GNUNET_TRANSPORT_cmd_stop_peer("stop-peer", "start-peer"), GNUNET_TESTING_cmd_system_destroy("system-destroy", "system-create")) | |
void * | libgnunet_test_transport_plugin_cmd_udp_backchannel_done (void *cls) |
Exit point from the plugin. More... | |
Variables | |
static struct GNUNET_TESTING_Command | block_send |
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_from (kind, "udp-backchannel", __VA_ARGS__) |
Generic logging shortcut.
Definition at line 38 of file plugin_testing_transport_udp_backchannel.c.
#define BASE_DIR "testdir" |
Definition at line 40 of file plugin_testing_transport_udp_backchannel.c.
#define TOPOLOGY_CONFIG "test_transport_udp_backchannel_topo.conf" |
Definition at line 42 of file plugin_testing_transport_udp_backchannel.c.
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) |
Definition at line 44 of file plugin_testing_transport_udp_backchannel.c.
|
static |
Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being received.
Definition at line 61 of file plugin_testing_transport_udp_backchannel.c.
References GNUNET_OK.
|
static |
Function called to handle a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being received.
Definition at line 74 of file plugin_testing_transport_udp_backchannel.c.
struct GNUNET_TESTING_BarrierList * get_waiting_for_barriers | ( | ) |
Definition at line 89 of file plugin_testing_transport_udp_backchannel.c.
References GNUNET_new.
|
static |
Callback to set the flag indicating all peers started.
Will be called via the plugin api.
Definition at line 101 of file plugin_testing_transport_udp_backchannel.c.
References block_send, GNUNET_assert, GNUNET_TESTING_async_fail(), and GNUNET_TESTING_async_finish().
|
static |
Function called with the final result of the test.
cls | the struct MainParams |
rv | GNUNET_OK if the test passed |
Definition at line 122 of file plugin_testing_transport_udp_backchannel.c.
References TestState::cfgname, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_TESTING_free_topology(), TestState::testdir, and TestState::topology.
|
static |
Callback from start peer cmd for signaling a peer got connected.
Definition at line 144 of file plugin_testing_transport_udp_backchannel.c.
References connect_peers, is, ConnectPeersState::notify_connect, and ret.
Referenced by libgnunet_test_transport_plugin_cmd_udp_backchannel_init().
|
static |
Callback to set the flag indicating all peers are prepared to finish.
Will be called via the plugin api.
Definition at line 163 of file plugin_testing_transport_udp_backchannel.c.
References GNUNET_assert, GNUNET_TESTING_async_fail(), GNUNET_TESTING_async_finish(), and local_prepared.
void * libgnunet_test_transport_plugin_cmd_udp_backchannel_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | NULL |
Definition at line 185 of file plugin_testing_transport_udp_backchannel.c.
References BASE_DIR, 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_end(), GNUNET_TESTING_make_plugin(), GNUNET_TRANSPORT_cmd_backchannel_check(), GNUNET_TRANSPORT_cmd_connect_peers(), GNUNET_TRANSPORT_cmd_start_peer(), GNUNET_TRANSPORT_cmd_stop_peer(), GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE, GNUNET_YES, handlers, local_prepared, LOG, m, GNUNET_TESTING_NetjailTopology::nodes_x, notify_connect(), read_file(), TestState::testdir, TestState::topology, and write_message().
GNUNET_TESTING_MAKE_PLUGIN | ( | libgnunet | , |
udp_backchannel | , | ||
GNUNET_TESTING_cmd_system_create("system-create", ts->testdir) | , | ||
GNUNET_TRANSPORT_cmd_start_peer("start-peer", "system-create", num, node_ip, handlers, ts->cfgname, notify_connect, GNUNET_NO) | , | ||
GNUNET_TESTING_cmd_send_peer_ready("send-peer-ready", write_message) | , | ||
block_send | , | ||
connect_peers | , | ||
GNUNET_TRANSPORT_cmd_backchannel_check("backchannel-check", "start-peer", "system-create", num, m_int, n_int, topology) | , | ||
local_prepared | , | ||
GNUNET_TRANSPORT_cmd_stop_peer("stop-peer", "start-peer") | , | ||
GNUNET_TESTING_cmd_system_destroy("system-destroy", "system-create") | |||
) |
void * libgnunet_test_transport_plugin_cmd_udp_backchannel_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | the return value from #libgnunet_test_transport_plugin_block_test_init |
Definition at line 355 of file plugin_testing_transport_udp_backchannel.c.
References GNUNET_TESTING_PluginFunctions::cls, and GNUNET_free.
|
static |
Definition at line 46 of file plugin_testing_transport_udp_backchannel.c.
Referenced by all_peers_started(), and libgnunet_test_transport_plugin_cmd_udp_backchannel_init().
|
static |
Definition at line 48 of file plugin_testing_transport_udp_backchannel.c.
Referenced by libgnunet_test_transport_plugin_cmd_udp_backchannel_init(), and notify_connect().
|
static |
Definition at line 50 of file plugin_testing_transport_udp_backchannel.c.
Referenced by all_local_tests_prepared(), and libgnunet_test_transport_plugin_cmd_udp_backchannel_init().
|
static |
Definition at line 52 of file plugin_testing_transport_udp_backchannel.c.
Referenced by notify_connect().