From 8cd4dadfb9ebd4db232fda79d5c4353eacb15690 Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Tue, 9 Nov 2021 17:38:47 +0100 Subject: - moved global netjail methods to its own header file. - added configuration by string in test skript instead of config file. - moved netjail scripts to contrib/netjail and install them into the share/gnunet directory. --- src/transport/test_transport_plugin_cmd_simple_send.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/transport/test_transport_plugin_cmd_simple_send.c') diff --git a/src/transport/test_transport_plugin_cmd_simple_send.c b/src/transport/test_transport_plugin_cmd_simple_send.c index c374fc2d0..2c987e601 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send.c +++ b/src/transport/test_transport_plugin_cmd_simple_send.c @@ -25,6 +25,7 @@ */ #include "platform.h" #include "gnunet_testing_ng_lib.h" +#include "gnunet_testing_netjail_lib.h" #include "gnunet_util_lib.h" #include "gnunet_transport_application_service.h" #include "transport-testing2.h" @@ -213,7 +214,9 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, char *node_ip, char *m, char *n, - char *local_m) + char *local_m, + char *topology_data, + unsigned int *read_file) { unsigned int n_int; @@ -221,8 +224,16 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, unsigned int local_m_int; unsigned int num; struct TestState *ts = GNUNET_new (struct TestState); - struct GNUNET_TESTING_NetjailTopology *topology = - GNUNET_TESTING_get_topo_from_file (TOPOLOGY_CONFIG); + struct GNUNET_TESTING_NetjailTopology *topology; + + if (GNUNET_YES == *read_file) + { + LOG (GNUNET_ERROR_TYPE_DEBUG, + "read from file\n"); + topology = GNUNET_TESTING_get_topo_from_file (topology_data); + } + else + topology = GNUNET_TESTING_get_topo_from_string (topology_data); ts->topology = topology; -- cgit v1.2.3