From 58b837048d27e04db8f5c02d6559fe7880c6cdb3 Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Mon, 16 Aug 2021 09:20:39 +0200 Subject: - small changes to simple send --- src/transport/Makefile.am | 28 +++++++++++----------- src/transport/plugin_cmd_simple_send.c | 15 ++++++------ src/transport/test_transport_api_cmd_simple_send.c | 11 +++++---- 3 files changed, 29 insertions(+), 25 deletions(-) (limited to 'src/transport') diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 55a338729..e19ebd8e9 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -398,20 +398,20 @@ plugin_LTLIBRARIES = \ $(HTTP_SERVER_PLUGIN_LA) \ $(HTTPS_SERVER_PLUGIN_LA) \ $(WLAN_PLUGIN_LA) \ - $(BT_PLUGIN_LA) -# libgnunet_plugin_cmd_simple_send.la - -#libgnunet_plugin_cmd_simple_send_la_SOURCES = \ -# plugin_cmd_simple_send.c -#libgnunet_plugin_cmd_simple_send_la_LIBADD = \ -# $(top_builddir)/src/util/libgnunetutil.la \ -# $(top_builddir)/src/testing/libgnunettesting.la \ -# $(top_builddir)/src/statistics/libgnunetstatistics.la \ -# $(top_builddir)/src/testbed/libgnunettestbed.la \ -# libgnunettransporttesting2.la \ -# $(LTLIBINTL) -#libgnunet_plugin_cmd_simple_send_la_LDFLAGS = \ -# $(GN_PLUGIN_LDFLAGS) + $(BT_PLUGIN_LA) \ + libgnunet_plugin_cmd_simple_send.la + +libgnunet_plugin_cmd_simple_send_la_SOURCES = \ + plugin_cmd_simple_send.c +libgnunet_plugin_cmd_simple_send_la_LIBADD = \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/testing/libgnunettesting.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/testbed/libgnunettestbed.la \ + libgnunettransporttesting2.la \ + $(LTLIBINTL) +libgnunet_plugin_cmd_simple_send_la_LDFLAGS = \ + $(GN_PLUGIN_LDFLAGS) if HAVE_EXPERIMENTAL plugin_LTLIBRARIES += libgnunet_plugin_transport_udp.la diff --git a/src/transport/plugin_cmd_simple_send.c b/src/transport/plugin_cmd_simple_send.c index e2407c8c0..2a4a8c137 100644 --- a/src/transport/plugin_cmd_simple_send.c +++ b/src/transport/plugin_cmd_simple_send.c @@ -98,13 +98,13 @@ start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, n); LOG (GNUNET_ERROR_TYPE_ERROR, - "cfgname: %s\n", + "plugin cfgname: %s\n", cfgname); LOG (GNUNET_ERROR_TYPE_ERROR, "node ip: %s\n", node_ip); - + testdir = GNUNET_malloc (strlen (BASE_DIR) + strlen (m) + strlen (n) + 1); @@ -142,11 +142,12 @@ start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, "start-peer-1", "this is useless"), GNUNET_TRANSPORT_cmd_send_simple ("send-simple-1", - m, - n, - 0, - "start-peer-1", - "this is useless"), + m, + n, + (atoi (n) - 1) * atoi (local_m) + atoi ( + m), + "start-peer-1", + "this is useless"), GNUNET_TESTING_cmd_local_test_finished ("local-test-finished-1", write_message) }; diff --git a/src/transport/test_transport_api_cmd_simple_send.c b/src/transport/test_transport_api_cmd_simple_send.c index 9ae8fcc2b..26da53c47 100644 --- a/src/transport/test_transport_api_cmd_simple_send.c +++ b/src/transport/test_transport_api_cmd_simple_send.c @@ -28,6 +28,10 @@ #include "gnunet_testbed_ng_service.h" #include "gnunet_util_lib.h" +#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120) + +static unsigned int rv = 0; + /** * Main function to run the test cases. @@ -45,7 +49,8 @@ run (void *cls) GNUNET_TESTBED_cmd_netjail_start_testbed ("netjail-start-testbed-1", "2", "1", - "libgnunet_plugin_cmd_simple_send"), + "libgnunet_plugin_cmd_simple_send", + &rv), GNUNET_TESTBED_cmd_stop_testbed ("stop-testbed", "netjail-start-testbed-1", "2", @@ -58,7 +63,7 @@ run (void *cls) GNUNET_TESTING_run (NULL, commands, - GNUNET_TIME_UNIT_FOREVER_REL); + TIMEOUT); } @@ -66,8 +71,6 @@ int main (int argc, char *const *argv) { - int rv = 0; - GNUNET_log_setup ("test-netjail", "DEBUG", NULL); -- cgit v1.2.3