#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"
#include "gnunet_core_service.h"
Go to the source code of this file.
Data Structures | |
struct | Sender |
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) |
#define | MAX_RECEIVED 1000 |
#define | MESSAGE_SIZE 65000 |
Functions | |
static int | check_test (void *cls, const struct GNUNET_TRANSPORT_TESTING_PerformanceTestMessage *message) |
Function called to check 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 | all_local_tests_prepared () |
Callback from start peer cmd for signaling a peer got connected. More... | |
static void | child_completed_callback (void *cls, enum GNUNET_OS_ProcessStatusType type, long unsigned int exit_code) |
static int | check_encrypted (void *cls, struct GNUNET_MessageHeader *header) |
Function called to check a message being received. More... | |
static void | core_receive_continue (struct GNUNET_PeerIdentity *peer) |
static void | handle_encrypted (void *cls, struct GNUNET_MessageHeader *header) |
Function called to handle a message being received. More... | |
static void | handle_ephemeral_key (void *cls, struct GNUNET_MessageHeader *header) |
static void | handle_ping (void *cls, struct GNUNET_MessageHeader *header) |
static void | handle_pong (void *cls, struct GNUNET_MessageHeader *header) |
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_just_run_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_test_transport_plugin_cmd_just_run_done (void *cls) |
Exit point from the plugin. More... | |
Variables | |
static struct GNUNET_TESTING_Command | block_script |
static struct GNUNET_TESTING_Command | connect_peers |
static struct GNUNET_TESTING_Command | local_prepared |
static struct GNUNET_TESTING_Command | start_peer |
static struct GNUNET_TESTING_Interpreter * | is |
static struct GNUNET_CONTAINER_MultiPeerMap * | senders |
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut.
Definition at line 39 of file plugin_testing_transport_just_run.c.
#define BASE_DIR "testdir" |
Definition at line 41 of file plugin_testing_transport_just_run.c.
#define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" |
Definition at line 43 of file plugin_testing_transport_just_run.c.
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) |
Definition at line 45 of file plugin_testing_transport_just_run.c.
#define MAX_RECEIVED 1000 |
Definition at line 47 of file plugin_testing_transport_just_run.c.
#define MESSAGE_SIZE 65000 |
Definition at line 49 of file plugin_testing_transport_just_run.c.
|
static |
Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being received.
Definition at line 87 of file plugin_testing_transport_just_run.c.
References GNUNET_OK.
struct GNUNET_TESTING_BarrierList * get_waiting_for_barriers | ( | ) |
Definition at line 96 of file plugin_testing_transport_just_run.c.
References GNUNET_CONTAINER_DLL_insert, and GNUNET_new.
Referenced by libgnunet_test_transport_plugin_cmd_just_run_init().
|
static |
Callback to set the flag indicating all peers started.
Will be called via the plugin api.
Definition at line 124 of file plugin_testing_transport_just_run.c.
|
static |
Function called with the final result of the test.
cls | the struct MainParams |
rv | GNUNET_OK if the test passed |
Definition at line 136 of file plugin_testing_transport_just_run.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.
static void * notify_connect (struct GNUNET_TESTING_Interpreter *is, const struct GNUNET_PeerIdentity *peer) { const struct ConnectPeersState *cps; const struct GNUNET_TESTING_Command *cmd;
cmd = GNUNET_TESTING_interpreter_lookup_command (is, "connect-peers"); GNUNET_TRANSPORT_get_trait_connect_peer_state (cmd, &cps); void *ret = NULL;
cps->notify_connect (is, peer); return ret; } Callback to set the flag indicating all peers are prepared to finish. Will be called via the plugin api.
Definition at line 180 of file plugin_testing_transport_just_run.c.
References GNUNET_assert, GNUNET_TESTING_async_fail(), GNUNET_TESTING_async_finish(), and local_prepared.
|
static |
Definition at line 196 of file plugin_testing_transport_just_run.c.
Referenced by start_testcase().
|
static |
Function called to check a message being received.
Definition at line 210 of file plugin_testing_transport_just_run.c.
References GNUNET_OK.
|
static |
Definition at line 217 of file plugin_testing_transport_just_run.c.
References GNUNET_ERROR_TYPE_DEBUG, LOG, GNUNET_TESTING_StartPeerState::peer, start_peer, and GNUNET_TESTING_StartPeerState::th.
Referenced by handle_encrypted(), handle_ephemeral_key(), handle_ping(), and handle_pong().
|
static |
Function called to handle a message being received.
Definition at line 245 of file plugin_testing_transport_just_run.c.
References core_receive_continue().
|
static |
Definition at line 254 of file plugin_testing_transport_just_run.c.
References core_receive_continue().
|
static |
Definition at line 263 of file plugin_testing_transport_just_run.c.
References core_receive_continue().
|
static |
Definition at line 272 of file plugin_testing_transport_just_run.c.
References core_receive_continue().
|
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 297 of file plugin_testing_transport_just_run.c.
References BASE_DIR, block_script, TestState::cfgname, child_completed_callback(), commands, connect_peers, finished_cb(), GNUNET_asprintf(), GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_log_strerror, GNUNET_new, GNUNET_NO, GNUNET_TESTING_cmd_barrier_reached(), GNUNET_TESTING_cmd_end(), GNUNET_TESTING_cmd_start_peer(), GNUNET_TESTING_run(), GNUNET_TRANSPORT_cmd_connect_peers(), GNUNET_TRANSPORT_cmd_stop_peer(), GNUNET_YES, handle_result(), is, local_prepared, LOG, m, GNUNET_TESTING_NetjailTopology::nodes_x, read_file(), start_peer, TestState::testdir, TIMEOUT, TestState::topology, and write_message().
Referenced by libgnunet_test_transport_plugin_cmd_just_run_init().
void * libgnunet_test_transport_plugin_cmd_just_run_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | NULL |
Definition at line 463 of file plugin_testing_transport_just_run.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_just_run_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | the return value from #libgnunet_test_transport_plugin_just_run_init |
Definition at line 485 of file plugin_testing_transport_just_run.c.
References GNUNET_TESTING_PluginFunctions::cls, and GNUNET_free.
|
static |
Definition at line 51 of file plugin_testing_transport_just_run.c.
Referenced by start_testcase().
|
static |
Definition at line 53 of file plugin_testing_transport_just_run.c.
Referenced by start_testcase().
|
static |
Definition at line 55 of file plugin_testing_transport_just_run.c.
Referenced by all_local_tests_prepared(), and start_testcase().
|
static |
Definition at line 57 of file plugin_testing_transport_just_run.c.
Referenced by core_receive_continue(), and start_testcase().
|
static |
Definition at line 59 of file plugin_testing_transport_just_run.c.
Referenced by start_testcase().
|
static |
Definition at line 61 of file plugin_testing_transport_just_run.c.