aboutsummaryrefslogtreecommitdiff
path: root/src/testbed
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2021-07-28 15:52:48 +0200
committert3sserakt <t3ss@posteo.de>2021-07-28 15:52:48 +0200
commit1a542d67de29d6ed40706ca70988f79bfd00fb38 (patch)
tree59e314aba37ca93411c32c5c6909192c85cfc4f7 /src/testbed
parentf550f04aa52852ca0d04552a5e103f51ff1023e6 (diff)
downloadgnunet-1a542d67de29d6ed40706ca70988f79bfd00fb38.tar.gz
gnunet-1a542d67de29d6ed40706ca70988f79bfd00fb38.zip
- simple test without sending. peers setup working.
Diffstat (limited to 'src/testbed')
-rw-r--r--src/testbed/Makefile.am2
-rw-r--r--src/testbed/gnunet-cmds-helper.c2
-rw-r--r--src/testbed/testbed_api.h2
-rw-r--r--src/testbed/testbed_api_cmd_local_test_finished.c2
-rw-r--r--src/testbed/testbed_api_cmd_netjail_start_testbed.c13
5 files changed, 16 insertions, 5 deletions
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am
index c1d89607c..347d16007 100644
--- a/src/testbed/Makefile.am
+++ b/src/testbed/Makefile.am
@@ -102,6 +102,8 @@ gnunet_cmds_helper_SOURCES = \
102gnunet_cmds_helper_LDADD = $(XLIB) \ 102gnunet_cmds_helper_LDADD = $(XLIB) \
103 $(top_builddir)/src/util/libgnunetutil.la \ 103 $(top_builddir)/src/util/libgnunetutil.la \
104 $(top_builddir)/src/testing/libgnunettesting.la \ 104 $(top_builddir)/src/testing/libgnunettesting.la \
105 $(top_builddir)/src/transport/libgnunettransporttesting2.la \
106 libgnunettestbed.la \
105 $(LTLIBINTL) $(Z_LIBS) 107 $(LTLIBINTL) $(Z_LIBS)
106 108
107gnunet_daemon_testbed_blacklist_SOURCES = gnunet-daemon-testbed-blacklist.c 109gnunet_daemon_testbed_blacklist_SOURCES = gnunet-daemon-testbed-blacklist.c
diff --git a/src/testbed/gnunet-cmds-helper.c b/src/testbed/gnunet-cmds-helper.c
index 113e3c386..c4a3e98d9 100644
--- a/src/testbed/gnunet-cmds-helper.c
+++ b/src/testbed/gnunet-cmds-helper.c
@@ -411,7 +411,7 @@ tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message)
411 plugin = GNUNET_new (struct Plugin); 411 plugin = GNUNET_new (struct Plugin);
412 plugin->api = GNUNET_PLUGIN_load (plugin_name, 412 plugin->api = GNUNET_PLUGIN_load (plugin_name,
413 NULL); 413 NULL);
414 plugin->library_name = GNUNET_strdup (plugin_name); 414 plugin->library_name = GNUNET_strdup (basename(plugin_name));
415 415
416 plugin->global_n = ni->global_n; 416 plugin->global_n = ni->global_n;
417 plugin->local_m = ni->local_m; 417 plugin->local_m = ni->local_m;
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h
index 9a54ca36c..67aa6dc1c 100644
--- a/src/testbed/testbed_api.h
+++ b/src/testbed/testbed_api.h
@@ -40,7 +40,7 @@
40/** 40/**
41 * Cmds Helper binary name 41 * Cmds Helper binary name
42 */ 42 */
43#define HELPER_CMDS_BINARY "gnunet-cmds-helper" 43#define HELPER_CMDS_BINARY "./../testbed/gnunet-cmds-helper"
44 44
45 45
46/** 46/**
diff --git a/src/testbed/testbed_api_cmd_local_test_finished.c b/src/testbed/testbed_api_cmd_local_test_finished.c
index 8829f1b9a..b5f4b8b31 100644
--- a/src/testbed/testbed_api_cmd_local_test_finished.c
+++ b/src/testbed/testbed_api_cmd_local_test_finished.c
@@ -93,6 +93,8 @@ local_test_finished_finish (void *cls,
93 void *cont_cls) 93 void *cont_cls)
94{ 94{
95 // This will stop the local loop without shutting down the scheduler, because we do not call the continuation, which is the interpreter_next method. 95 // This will stop the local loop without shutting down the scheduler, because we do not call the continuation, which is the interpreter_next method.
96 LOG (GNUNET_ERROR_TYPE_ERROR,
97 "Stopping local loop\n");
96 return GNUNET_YES; 98 return GNUNET_YES;
97} 99}
98 100
diff --git a/src/testbed/testbed_api_cmd_netjail_start_testbed.c b/src/testbed/testbed_api_cmd_netjail_start_testbed.c
index 67f0ef55c..de3926696 100644
--- a/src/testbed/testbed_api_cmd_netjail_start_testbed.c
+++ b/src/testbed/testbed_api_cmd_netjail_start_testbed.c
@@ -328,8 +328,7 @@ start_testbed (struct NetJailState *ns, struct
328 char *const script_argv[] = {NETJAIL_EXEC_SCRIPT, 328 char *const script_argv[] = {NETJAIL_EXEC_SCRIPT,
329 m_char, 329 m_char,
330 n_char, 330 n_char,
331 GNUNET_OS_get_libexec_binary_path ( 331 HELPER_CMDS_BINARY,
332 HELPER_CMDS_BINARY),
333 ns->global_n, 332 ns->global_n,
334 ns->local_m, 333 ns->local_m,
335 NULL}; 334 NULL};
@@ -373,6 +372,9 @@ start_testbed (struct NetJailState *ns, struct
373 &exp_cb, 372 &exp_cb,
374 tbc)); 373 tbc));
375 374
375 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
376 "First using helper %d\n",
377 tbc->count - 1);
376 struct GNUNET_HELPER_Handle *helper = ns->helper[tbc->count - 1]; 378 struct GNUNET_HELPER_Handle *helper = ns->helper[tbc->count - 1];
377 379
378 msg = create_helper_init_msg_ (m_char, 380 msg = create_helper_init_msg_ (m_char,
@@ -469,7 +471,12 @@ netjail_start_finish (void *cls,
469 tbc = GNUNET_new (struct TestbedCount); 471 tbc = GNUNET_new (struct TestbedCount);
470 tbc->ns = ns; 472 tbc->ns = ns;
471 // TODO This needs to be more generic. As we send more messages back and forth, we can not grow the arrays again and again, because this is to error prone. 473 // TODO This needs to be more generic. As we send more messages back and forth, we can not grow the arrays again and again, because this is to error prone.
472 tbc->count = (j - 1) * atoi (ns->local_m) + i + total_number; 474 tbc->count = (i - 1) * atoi (ns->local_m) + j + total_number;
475 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
476 "Second using helper %d %d %d\n",
477 tbc->count - 1 - total_number,
478 i,
479 j);
473 helper = ns->helper[tbc->count - 1 - total_number]; 480 helper = ns->helper[tbc->count - 1 - total_number];
474 msg_length = sizeof(struct GNUNET_CMDS_ALL_PEERS_STARTED); 481 msg_length = sizeof(struct GNUNET_CMDS_ALL_PEERS_STARTED);
475 reply = GNUNET_new (struct GNUNET_CMDS_ALL_PEERS_STARTED); 482 reply = GNUNET_new (struct GNUNET_CMDS_ALL_PEERS_STARTED);