diff options
author | t3sserakt <t3ss@posteo.de> | 2021-07-23 22:17:29 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2021-07-23 22:17:29 +0200 |
commit | 63a7eb6a3a94d43368b348c0a677bc77653cbe51 (patch) | |
tree | 2d9608a54ab9b13afb080335e092ad452e54fdc5 | |
parent | 6140d64e1c55e76de3ff520143b10290fa1ba197 (diff) | |
download | gnunet-63a7eb6a3a94d43368b348c0a677bc77653cbe51.tar.gz gnunet-63a7eb6a3a94d43368b348c0a677bc77653cbe51.zip |
- smaller bug fixes
-rw-r--r-- | src/include/gnunet_testing_ng_lib.h | 25 | ||||
-rw-r--r-- | src/include/gnunet_transport_service.h | 14 | ||||
-rw-r--r-- | src/testbed/Makefile.am | 1 | ||||
-rwxr-xr-x | src/testbed/netjail_exec.sh | 2 | ||||
-rwxr-xr-x | src/testbed/netjail_start.sh | 2 | ||||
-rwxr-xr-x | src/testbed/netjail_stop.sh | 2 | ||||
-rw-r--r-- | src/testbed/testbed_api_cmd_netjail_start.c | 2 | ||||
-rw-r--r-- | src/testbed/testbed_api_cmd_netjail_start_testbed.c | 24 | ||||
-rw-r--r-- | src/testbed/testbed_api_cmd_netjail_stop.c | 2 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_system_create.c | 5 | ||||
-rw-r--r-- | src/transport/Makefile.am | 28 | ||||
-rw-r--r-- | src/transport/plugin_cmd_simple_send.c | 74 | ||||
-rw-r--r-- | src/transport/test_transport_api_cmd_simple_send.c | 8 | ||||
-rw-r--r-- | src/transport/transport-testing2.h | 37 | ||||
-rw-r--r-- | src/transport/transport_api_cmd_connecting_peers.c | 14 | ||||
-rw-r--r-- | src/transport/transport_api_cmd_send_simple.c | 8 | ||||
-rw-r--r-- | src/transport/transport_api_cmd_start_peer.c | 34 |
17 files changed, 169 insertions, 113 deletions
diff --git a/src/include/gnunet_testing_ng_lib.h b/src/include/gnunet_testing_ng_lib.h index 08bc63aae..aad7ddec2 100644 --- a/src/include/gnunet_testing_ng_lib.h +++ b/src/include/gnunet_testing_ng_lib.h | |||
@@ -833,31 +833,6 @@ GNUNET_TESTING_get_trait_what_am_i (const struct GNUNET_TESTING_Command *cmd, | |||
833 | char **what_am_i); | 833 | char **what_am_i); |
834 | 834 | ||
835 | 835 | ||
836 | |||
837 | int | ||
838 | GNUNET_TESTING_get_trait_peer_id (const struct | ||
839 | GNUNET_TESTING_Command *cmd, | ||
840 | struct GNUNET_PeerIdentity **id); | ||
841 | |||
842 | int | ||
843 | GNUNET_TESTING_get_trait_connected_peers_map (const struct | ||
844 | GNUNET_TESTING_Command | ||
845 | *cmd, | ||
846 | struct | ||
847 | GNUNET_CONTAINER_MultiPeerMap ** | ||
848 | connected_peers_map); | ||
849 | int | ||
850 | GNUNET_TESTING_get_trait_hello_size (const struct | ||
851 | GNUNET_TESTING_Command | ||
852 | *cmd, | ||
853 | size_t **hello_size); | ||
854 | |||
855 | int | ||
856 | GNUNET_TESTING_get_trait_hello (const struct | ||
857 | GNUNET_TESTING_Command | ||
858 | *cmd, | ||
859 | char **hello); | ||
860 | |||
861 | int | 836 | int |
862 | GNUNET_TESTING_get_trait_test_system (const struct | 837 | GNUNET_TESTING_get_trait_test_system (const struct |
863 | GNUNET_TESTING_Command *cmd, | 838 | GNUNET_TESTING_Command *cmd, |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 97dfda1ec..d190eff92 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -686,20 +686,6 @@ GNUNET_TRANSPORT_core_get_mq (struct GNUNET_TRANSPORT_CoreHandle *handle, | |||
686 | const struct GNUNET_PeerIdentity *peer); | 686 | const struct GNUNET_PeerIdentity *peer); |
687 | 687 | ||
688 | 688 | ||
689 | struct GNUNET_TESTING_Command | ||
690 | GNUNET_TRANSPORT_cmd_start_peer (const char *label, | ||
691 | const char *system_label, | ||
692 | char *m, | ||
693 | char *n, | ||
694 | struct GNUNET_MQ_MessageHandler *handlers, | ||
695 | const char *cfgname); | ||
696 | |||
697 | struct GNUNET_TESTING_Command | ||
698 | GNUNET_TRANSPORT_cmd_connect_peers (const char *label, | ||
699 | const char *peer1_label, | ||
700 | const char *peer2_label); | ||
701 | |||
702 | |||
703 | #if 0 /* keep Emacsens' auto-indent happy */ | 689 | #if 0 /* keep Emacsens' auto-indent happy */ |
704 | { | 690 | { |
705 | #endif | 691 | #endif |
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am index 201b4c1ff..a9837daf5 100644 --- a/src/testbed/Makefile.am +++ b/src/testbed/Makefile.am | |||
@@ -101,6 +101,7 @@ gnunet_cmds_helper_SOURCES = \ | |||
101 | gnunet_cmds_helper_LDADD = $(XLIB) \ | 101 | gnunet_cmds_helper_LDADD = $(XLIB) \ |
102 | $(top_builddir)/src/util/libgnunetutil.la \ | 102 | $(top_builddir)/src/util/libgnunetutil.la \ |
103 | $(top_builddir)/src/testing/libgnunettesting.la \ | 103 | $(top_builddir)/src/testing/libgnunettesting.la \ |
104 | $(top_builddir)/src/transport/libgnunettransport.la \ | ||
104 | libgnunettestbed.la \ | 105 | libgnunettestbed.la \ |
105 | $(LTLIBINTL) $(Z_LIBS) | 106 | $(LTLIBINTL) $(Z_LIBS) |
106 | 107 | ||
diff --git a/src/testbed/netjail_exec.sh b/src/testbed/netjail_exec.sh index 532f4711c..b76d2e444 100755 --- a/src/testbed/netjail_exec.sh +++ b/src/testbed/netjail_exec.sh | |||
@@ -1,5 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | . "./netjail_core.sh" | 2 | . "./../testbed/netjail_core.sh" |
3 | 3 | ||
4 | set -eu | 4 | set -eu |
5 | set -x | 5 | set -x |
diff --git a/src/testbed/netjail_start.sh b/src/testbed/netjail_start.sh index a2abca2d7..4c1c33c83 100755 --- a/src/testbed/netjail_start.sh +++ b/src/testbed/netjail_start.sh | |||
@@ -1,5 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | . "./netjail_core.sh" | 2 | . "./../testbed/netjail_core.sh" |
3 | 3 | ||
4 | set -eu | 4 | set -eu |
5 | set -x | 5 | set -x |
diff --git a/src/testbed/netjail_stop.sh b/src/testbed/netjail_stop.sh index 4763cb107..689bf7ae9 100755 --- a/src/testbed/netjail_stop.sh +++ b/src/testbed/netjail_stop.sh | |||
@@ -1,5 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | . "./netjail_core.sh" | 2 | . "./../testbed/netjail_core.sh" |
3 | 3 | ||
4 | set -eu | 4 | set -eu |
5 | set -x | 5 | set -x |
diff --git a/src/testbed/testbed_api_cmd_netjail_start.c b/src/testbed/testbed_api_cmd_netjail_start.c index 1e37d5475..bc035abe7 100644 --- a/src/testbed/testbed_api_cmd_netjail_start.c +++ b/src/testbed/testbed_api_cmd_netjail_start.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "gnunet_testing_ng_lib.h" | 28 | #include "gnunet_testing_ng_lib.h" |
29 | #include "gnunet_testbed_ng_service.h" | 29 | #include "gnunet_testbed_ng_service.h" |
30 | 30 | ||
31 | #define NETJAIL_START_SCRIPT "./netjail_start.sh" | 31 | #define NETJAIL_START_SCRIPT "./../testbed/netjail_start.sh" |
32 | 32 | ||
33 | struct NetJailState | 33 | struct NetJailState |
34 | { | 34 | { |
diff --git a/src/testbed/testbed_api_cmd_netjail_start_testbed.c b/src/testbed/testbed_api_cmd_netjail_start_testbed.c index 9b68c52f6..67f0ef55c 100644 --- a/src/testbed/testbed_api_cmd_netjail_start_testbed.c +++ b/src/testbed/testbed_api_cmd_netjail_start_testbed.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include "testbed_api_hosts.h" | 30 | #include "testbed_api_hosts.h" |
31 | #include "testbed_helper.h" | 31 | #include "testbed_helper.h" |
32 | 32 | ||
33 | #define NETJAIL_EXEC_SCRIPT "./netjail_exec.sh" | 33 | #define NETJAIL_EXEC_SCRIPT "./../testbed/netjail_exec.sh" |
34 | 34 | ||
35 | struct HelperMessage; | 35 | struct HelperMessage; |
36 | 36 | ||
@@ -319,15 +319,15 @@ create_helper_init_msg_ (char *m_char, | |||
319 | static void | 319 | static void |
320 | start_testbed (struct NetJailState *ns, struct | 320 | start_testbed (struct NetJailState *ns, struct |
321 | GNUNET_CONFIGURATION_Handle *config, | 321 | GNUNET_CONFIGURATION_Handle *config, |
322 | char *n_char, | 322 | char *m_char, |
323 | char *m_char) | 323 | char *n_char) |
324 | { | 324 | { |
325 | struct GNUNET_CONFIGURATION_Handle *cfg; | 325 | // struct GNUNET_CONFIGURATION_Handle *cfg; |
326 | struct GNUNET_CMDS_HelperInit *msg; | 326 | struct GNUNET_CMDS_HelperInit *msg; |
327 | struct TestbedCount *tbc; | 327 | struct TestbedCount *tbc; |
328 | char *const script_argv[] = {NETJAIL_EXEC_SCRIPT, | 328 | char *const script_argv[] = {NETJAIL_EXEC_SCRIPT, |
329 | n_char, | ||
330 | m_char, | 329 | m_char, |
330 | n_char, | ||
331 | GNUNET_OS_get_libexec_binary_path ( | 331 | GNUNET_OS_get_libexec_binary_path ( |
332 | HELPER_CMDS_BINARY), | 332 | HELPER_CMDS_BINARY), |
333 | ns->global_n, | 333 | ns->global_n, |
@@ -345,17 +345,17 @@ start_testbed (struct NetJailState *ns, struct | |||
345 | tbc->ns = ns; | 345 | tbc->ns = ns; |
346 | tbc->count = (n - 1) * atoi (ns->local_m) + m; | 346 | tbc->count = (n - 1) * atoi (ns->local_m) + m; |
347 | 347 | ||
348 | cfg = GNUNET_CONFIGURATION_dup (config); | 348 | // cfg = GNUNET_CONFIGURATION_dup (config); |
349 | 349 | ||
350 | // TODO We do not need this? | 350 | // TODO We do not need this? |
351 | GNUNET_array_append (ns->host, ns->n_host, | 351 | /*GNUNET_array_append (ns->host, ns->n_host, |
352 | GNUNET_TESTBED_host_create_with_id (tbc->count - 1, | 352 | GNUNET_TESTBED_host_create_with_id (tbc->count - 1, |
353 | NULL, | 353 | NULL, |
354 | NULL, | 354 | NULL, |
355 | cfg, | 355 | cfg, |
356 | 0)); | 356 | 0));*/ |
357 | 357 | ||
358 | if ((GNUNET_YES != GNUNET_DISK_file_test ("test_testbed_api.conf")) || | 358 | /*if ((GNUNET_YES != GNUNET_DISK_file_test ("test_testbed_api.conf")) || |
359 | (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (config, | 359 | (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (config, |
360 | "test_testbed_api.conf"))) | 360 | "test_testbed_api.conf"))) |
361 | { | 361 | { |
@@ -363,7 +363,7 @@ start_testbed (struct NetJailState *ns, struct | |||
363 | _ ( | 363 | _ ( |
364 | "Unreadable or malformed configuration file `%s', exit ...\n"), | 364 | "Unreadable or malformed configuration file `%s', exit ...\n"), |
365 | "test_testbed_api.conf"); | 365 | "test_testbed_api.conf"); |
366 | } | 366 | }*/ |
367 | 367 | ||
368 | GNUNET_array_append (ns->helper, ns->n_helper, GNUNET_HELPER_start ( | 368 | GNUNET_array_append (ns->helper, ns->n_helper, GNUNET_HELPER_start ( |
369 | GNUNET_YES, | 369 | GNUNET_YES, |
@@ -425,8 +425,8 @@ netjail_exec_run (void *cls, | |||
425 | sprintf (str_n, "%d", i); | 425 | sprintf (str_n, "%d", i); |
426 | sprintf (str_m, "%d", j); | 426 | sprintf (str_m, "%d", j); |
427 | start_testbed (ns, config, | 427 | start_testbed (ns, config, |
428 | str_n, | 428 | str_m, |
429 | str_m); | 429 | str_n); |
430 | } | 430 | } |
431 | } | 431 | } |
432 | } | 432 | } |
diff --git a/src/testbed/testbed_api_cmd_netjail_stop.c b/src/testbed/testbed_api_cmd_netjail_stop.c index 1e6586f94..c0fc33ff9 100644 --- a/src/testbed/testbed_api_cmd_netjail_stop.c +++ b/src/testbed/testbed_api_cmd_netjail_stop.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include "gnunet_testbed_ng_service.h" | 29 | #include "gnunet_testbed_ng_service.h" |
30 | 30 | ||
31 | 31 | ||
32 | #define NETJAIL_STOP_SCRIPT "./netjail_stop.sh" | 32 | #define NETJAIL_STOP_SCRIPT "./../testbed/netjail_stop.sh" |
33 | 33 | ||
34 | struct GNUNET_ChildWaitHandle *cwh; | 34 | struct GNUNET_ChildWaitHandle *cwh; |
35 | 35 | ||
diff --git a/src/testing/testing_api_cmd_system_create.c b/src/testing/testing_api_cmd_system_create.c index a324940bb..2007b4ef3 100644 --- a/src/testing/testing_api_cmd_system_create.c +++ b/src/testing/testing_api_cmd_system_create.c | |||
@@ -43,10 +43,15 @@ system_create_run (void *cls, | |||
43 | { | 43 | { |
44 | struct TestSystemState *tss = cls; | 44 | struct TestSystemState *tss = cls; |
45 | 45 | ||
46 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
47 | "system create\n"); | ||
48 | |||
46 | tss->test_system = GNUNET_TESTING_system_create (tss->testdir, | 49 | tss->test_system = GNUNET_TESTING_system_create (tss->testdir, |
47 | NULL, | 50 | NULL, |
48 | NULL, | 51 | NULL, |
49 | NULL); | 52 | NULL); |
53 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
54 | "system created\n"); | ||
50 | } | 55 | } |
51 | 56 | ||
52 | static int | 57 | static int |
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 255a7973f..b59bfd0d4 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am | |||
@@ -397,20 +397,20 @@ plugin_LTLIBRARIES = \ | |||
397 | $(HTTP_SERVER_PLUGIN_LA) \ | 397 | $(HTTP_SERVER_PLUGIN_LA) \ |
398 | $(HTTPS_SERVER_PLUGIN_LA) \ | 398 | $(HTTPS_SERVER_PLUGIN_LA) \ |
399 | $(WLAN_PLUGIN_LA) \ | 399 | $(WLAN_PLUGIN_LA) \ |
400 | $(BT_PLUGIN_LA) | 400 | $(BT_PLUGIN_LA) \ |
401 | # libgnunet_plugin_cmd_simple_send.la | 401 | libgnunet_plugin_cmd_simple_send.la |
402 | 402 | ||
403 | # libgnunet_plugin_cmd_simple_send_la_SOURCES = \ | 403 | libgnunet_plugin_cmd_simple_send_la_SOURCES = \ |
404 | # plugin_cmd_simple_send.c | 404 | plugin_cmd_simple_send.c |
405 | # libgnunet_plugin_cmd_simple_send_la_LIBADD = \ | 405 | libgnunet_plugin_cmd_simple_send_la_LIBADD = \ |
406 | # $(top_builddir)/src/util/libgnunetutil.la \ | 406 | $(top_builddir)/src/util/libgnunetutil.la \ |
407 | # $(top_builddir)/src/testing/libgnunettesting.la \ | 407 | $(top_builddir)/src/testing/libgnunettesting.la \ |
408 | # $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 408 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
409 | # $(top_builddir)/src/testbed/libgnunettestbed.la \ | 409 | $(top_builddir)/src/testbed/libgnunettestbed.la \ |
410 | # libgnunettransport.la \ | 410 | libgnunettransporttesting2.la \ |
411 | # $(LTLIBINTL) | 411 | $(LTLIBINTL) |
412 | # libgnunet_plugin_cmd_simple_send_la_LDFLAGS = \ | 412 | libgnunet_plugin_cmd_simple_send_la_LDFLAGS = \ |
413 | # $(GN_PLUGIN_LDFLAGS) | 413 | $(GN_PLUGIN_LDFLAGS) |
414 | 414 | ||
415 | if HAVE_EXPERIMENTAL | 415 | if HAVE_EXPERIMENTAL |
416 | plugin_LTLIBRARIES += libgnunet_plugin_transport_udp.la | 416 | 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 1fa2f1f03..62bb7544b 100644 --- a/src/transport/plugin_cmd_simple_send.c +++ b/src/transport/plugin_cmd_simple_send.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file testbed/plugin_testcmd.c | 22 | * @file testbed/plugin_cmd_simple_send.c |
23 | * @brief a plugin to provide the API for running test cases. | 23 | * @brief a plugin to provide the API for running test cases. |
24 | * @author t3sserakt | 24 | * @author t3sserakt |
25 | */ | 25 | */ |
@@ -27,8 +27,10 @@ | |||
27 | #include "gnunet_testing_ng_lib.h" | 27 | #include "gnunet_testing_ng_lib.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | #include "gnunet_transport_application_service.h" | 29 | #include "gnunet_transport_application_service.h" |
30 | #include "gnunet_transport_service.h" | 30 | // #include "gnunet_transport_service.h" |
31 | #include "gnunet_testbed_ng_service.h" | 31 | #include "gnunet_testbed_ng_service.h" |
32 | #include "transport-testing2.h" | ||
33 | |||
32 | /** | 34 | /** |
33 | * Generic logging shortcut | 35 | * Generic logging shortcut |
34 | */ | 36 | */ |
@@ -38,10 +40,38 @@ | |||
38 | 40 | ||
39 | struct GNUNET_MQ_MessageHandler *handlers; | 41 | struct GNUNET_MQ_MessageHandler *handlers; |
40 | 42 | ||
41 | const char *cfgname; | ||
42 | |||
43 | unsigned int are_all_peers_started; | 43 | unsigned int are_all_peers_started; |
44 | 44 | ||
45 | static int | ||
46 | check_test (void *cls, | ||
47 | const struct GNUNET_TRANSPORT_TESTING_TestMessage *message) | ||
48 | { | ||
49 | return GNUNET_OK; | ||
50 | } | ||
51 | |||
52 | static void | ||
53 | handle_test (void *cls, | ||
54 | const struct GNUNET_TRANSPORT_TESTING_TestMessage *message) | ||
55 | { | ||
56 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
57 | "message received\n"); | ||
58 | } | ||
59 | |||
60 | static int | ||
61 | check_test2 (void *cls, | ||
62 | const struct GNUNET_TRANSPORT_TESTING_TestMessage *message) | ||
63 | { | ||
64 | return GNUNET_OK; | ||
65 | } | ||
66 | |||
67 | static void | ||
68 | handle_test2 (void *cls, | ||
69 | const struct GNUNET_TRANSPORT_TESTING_TestMessage *message) | ||
70 | { | ||
71 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
72 | "message received\n"); | ||
73 | } | ||
74 | |||
45 | static void | 75 | static void |
46 | all_peers_started () | 76 | all_peers_started () |
47 | { | 77 | { |
@@ -58,6 +88,16 @@ start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, | |||
58 | char *n) | 88 | char *n) |
59 | { | 89 | { |
60 | char *testdir; | 90 | char *testdir; |
91 | char *cfgname; | ||
92 | |||
93 | GNUNET_asprintf (&cfgname, | ||
94 | "%s%s.conf", | ||
95 | "test_transport_api2_tcp_peer", | ||
96 | n); | ||
97 | |||
98 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
99 | "cfgname: %s\n", | ||
100 | cfgname); | ||
61 | 101 | ||
62 | testdir = GNUNET_malloc (strlen (BASE_DIR) + strlen (m) + strlen (n) | 102 | testdir = GNUNET_malloc (strlen (BASE_DIR) + strlen (m) + strlen (n) |
63 | + 1); | 103 | + 1); |
@@ -66,22 +106,34 @@ start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, | |||
66 | strcat (testdir, m); | 106 | strcat (testdir, m); |
67 | strcat (testdir, n); | 107 | strcat (testdir, n); |
68 | 108 | ||
109 | struct GNUNET_MQ_MessageHandler handlers[] = { | ||
110 | GNUNET_MQ_hd_var_size (test, | ||
111 | GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE, | ||
112 | struct GNUNET_TRANSPORT_TESTING_TestMessage, | ||
113 | NULL), | ||
114 | GNUNET_MQ_hd_var_size (test2, | ||
115 | GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE2, | ||
116 | struct GNUNET_TRANSPORT_TESTING_TestMessage, | ||
117 | NULL), | ||
118 | GNUNET_MQ_handler_end () | ||
119 | }; | ||
120 | |||
69 | struct GNUNET_TESTING_Command commands[] = { | 121 | struct GNUNET_TESTING_Command commands[] = { |
70 | GNUNET_TESTING_cmd_system_create ("system-create-1", | 122 | GNUNET_TESTING_cmd_system_create ("system-create-1", |
71 | testdir), | 123 | testdir), |
72 | /*GNUNET_TRANSPORT_cmd_start_peer ("start-peer-1", | 124 | GNUNET_TRANSPORT_cmd_start_peer ("start-peer-1", |
73 | "system-create-1", | 125 | "system-create-1", |
74 | m, | 126 | m, |
75 | n, | 127 | n, |
76 | handlers, | 128 | handlers, |
77 | cfgname),*/ | 129 | cfgname), |
78 | GNUNET_TESTING_cmd_send_peer_ready ("send-peer-ready-1", | 130 | GNUNET_TESTING_cmd_send_peer_ready ("send-peer-ready-1", |
79 | write_message), | 131 | write_message), |
80 | GNUNET_TESTING_cmd_block_until_all_peers_started ("block-1", | 132 | GNUNET_TESTING_cmd_block_until_all_peers_started ("block-1", |
81 | &are_all_peers_started), | 133 | &are_all_peers_started), |
82 | /*GNUNET_TRANSPORT_cmd_connect_peers ("connect-peers-1", | 134 | GNUNET_TRANSPORT_cmd_connect_peers ("connect-peers-1", |
83 | "start-peer-1", | 135 | "start-peer-1", |
84 | "this is useless"),*/ | 136 | "this is useless"), |
85 | /*GNUNET_TESTING_cmd_send_simple ("send-simple-1", | 137 | /*GNUNET_TESTING_cmd_send_simple ("send-simple-1", |
86 | char *m, | 138 | char *m, |
87 | char *n, | 139 | char *n, |
@@ -106,7 +158,7 @@ start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, | |||
106 | * @return the exported block API | 158 | * @return the exported block API |
107 | */ | 159 | */ |
108 | void * | 160 | void * |
109 | libgnunet_plugin_testcmd_init (void *cls) | 161 | libgnunet_plugin_cmd_simple_send_init (void *cls) |
110 | { | 162 | { |
111 | struct GNUNET_TESTING_PluginFunctions *api; | 163 | struct GNUNET_TESTING_PluginFunctions *api; |
112 | 164 | ||
@@ -124,7 +176,7 @@ libgnunet_plugin_testcmd_init (void *cls) | |||
124 | * @return NULL | 176 | * @return NULL |
125 | */ | 177 | */ |
126 | void * | 178 | void * |
127 | libgnunet_plugin_testcmd_done (void *cls) | 179 | libgnunet_plugin_cmd_simple_send_done (void *cls) |
128 | { | 180 | { |
129 | struct GNUNET_TESTING_PluginFunctions *api = cls; | 181 | struct GNUNET_TESTING_PluginFunctions *api = cls; |
130 | 182 | ||
@@ -133,4 +185,4 @@ libgnunet_plugin_testcmd_done (void *cls) | |||
133 | } | 185 | } |
134 | 186 | ||
135 | 187 | ||
136 | /* end of plugin_testcmd.c */ | 188 | /* end of plugin_cmd_simple_send.c */ |
diff --git a/src/transport/test_transport_api_cmd_simple_send.c b/src/transport/test_transport_api_cmd_simple_send.c index 36c7d23b2..9ae8fcc2b 100644 --- a/src/transport/test_transport_api_cmd_simple_send.c +++ b/src/transport/test_transport_api_cmd_simple_send.c | |||
@@ -41,18 +41,18 @@ run (void *cls) | |||
41 | struct GNUNET_TESTING_Command commands[] = { | 41 | struct GNUNET_TESTING_Command commands[] = { |
42 | GNUNET_TESTBED_cmd_netjail_start ("netjail-start-1", | 42 | GNUNET_TESTBED_cmd_netjail_start ("netjail-start-1", |
43 | "2", | 43 | "2", |
44 | "2"), | 44 | "1"), |
45 | GNUNET_TESTBED_cmd_netjail_start_testbed ("netjail-start-testbed-1", | 45 | GNUNET_TESTBED_cmd_netjail_start_testbed ("netjail-start-testbed-1", |
46 | "2", | 46 | "2", |
47 | "2", | 47 | "1", |
48 | "libgnunet_plugin_cmd_simple_send"), | 48 | "libgnunet_plugin_cmd_simple_send"), |
49 | GNUNET_TESTBED_cmd_stop_testbed ("stop-testbed", | 49 | GNUNET_TESTBED_cmd_stop_testbed ("stop-testbed", |
50 | "netjail-start-testbed-1", | 50 | "netjail-start-testbed-1", |
51 | "2", | 51 | "2", |
52 | "2"), | 52 | "1"), |
53 | GNUNET_TESTBED_cmd_netjail_stop ("netjail-stop-1", | 53 | GNUNET_TESTBED_cmd_netjail_stop ("netjail-stop-1", |
54 | "2", | 54 | "2", |
55 | "2"), | 55 | "1"), |
56 | GNUNET_TESTING_cmd_end () | 56 | GNUNET_TESTING_cmd_end () |
57 | }; | 57 | }; |
58 | 58 | ||
diff --git a/src/transport/transport-testing2.h b/src/transport/transport-testing2.h index e2167ca7e..a6732e308 100644 --- a/src/transport/transport-testing2.h +++ b/src/transport/transport-testing2.h | |||
@@ -920,5 +920,42 @@ GNUNET_TRANSPORT_TESTING_get_test_plugin_name (const char *executable, | |||
920 | char * | 920 | char * |
921 | GNUNET_TRANSPORT_TESTING_get_test_source_name (const char *file); | 921 | GNUNET_TRANSPORT_TESTING_get_test_source_name (const char *file); |
922 | 922 | ||
923 | struct GNUNET_TESTING_Command | ||
924 | GNUNET_TRANSPORT_cmd_start_peer (const char *label, | ||
925 | const char *system_label, | ||
926 | char *m, | ||
927 | char *n, | ||
928 | struct GNUNET_MQ_MessageHandler *handlers, | ||
929 | const char *cfgname); | ||
930 | |||
931 | struct GNUNET_TESTING_Command | ||
932 | GNUNET_TRANSPORT_cmd_connect_peers (const char *label, | ||
933 | const char *peer1_label, | ||
934 | const char *peer2_label); | ||
935 | |||
936 | int | ||
937 | GNUNET_TRANSPORT_get_trait_peer_id (const struct | ||
938 | GNUNET_TESTING_Command *cmd, | ||
939 | struct GNUNET_PeerIdentity **id); | ||
940 | |||
941 | int | ||
942 | GNUNET_TRANSPORT_get_trait_connected_peers_map (const struct | ||
943 | GNUNET_TESTING_Command | ||
944 | *cmd, | ||
945 | struct | ||
946 | GNUNET_CONTAINER_MultiPeerMap ** | ||
947 | connected_peers_map); | ||
948 | int | ||
949 | GNUNET_TRANSPORT_get_trait_hello_size (const struct | ||
950 | GNUNET_TESTING_Command | ||
951 | *cmd, | ||
952 | size_t **hello_size); | ||
953 | |||
954 | int | ||
955 | GNUNET_TRANSPORT_get_trait_hello (const struct | ||
956 | GNUNET_TESTING_Command | ||
957 | *cmd, | ||
958 | char **hello); | ||
959 | |||
923 | #endif | 960 | #endif |
924 | /* end of transport_testing.h */ | 961 | /* end of transport_testing.h */ |
diff --git a/src/transport/transport_api_cmd_connecting_peers.c b/src/transport/transport_api_cmd_connecting_peers.c index 06e2b8d61..0f2154c46 100644 --- a/src/transport/transport_api_cmd_connecting_peers.c +++ b/src/transport/transport_api_cmd_connecting_peers.c | |||
@@ -63,8 +63,8 @@ connect_peers_run (void *cls, | |||
63 | GNUNET_TRANSPORT_get_trait_application_handle (peer1_cmd, | 63 | GNUNET_TRANSPORT_get_trait_application_handle (peer1_cmd, |
64 | &ah); | 64 | &ah); |
65 | 65 | ||
66 | GNUNET_TESTING_get_trait_hello (peer1_cmd, | 66 | GNUNET_TRANSPORT_get_trait_hello (peer1_cmd, |
67 | &hello); | 67 | &hello); |
68 | 68 | ||
69 | LOG (GNUNET_ERROR_TYPE_ERROR, | 69 | LOG (GNUNET_ERROR_TYPE_ERROR, |
70 | "hello: %s\n", | 70 | "hello: %s\n", |
@@ -73,11 +73,11 @@ connect_peers_run (void *cls, | |||
73 | // TODO This does not work, because the other peer is running in another local loop. We need to message between different local loops. For now we will create the hello manually with the known information about the other local peers. | 73 | // TODO This does not work, because the other peer is running in another local loop. We need to message between different local loops. For now we will create the hello manually with the known information about the other local peers. |
74 | // --------------------------------------------- | 74 | // --------------------------------------------- |
75 | /*peer2_cmd = GNUNET_TESTING_interpreter_lookup_command (cps->peer2_label); | 75 | /*peer2_cmd = GNUNET_TESTING_interpreter_lookup_command (cps->peer2_label); |
76 | GNUNET_TESTING_get_trait_peer_id (peer2_cmd, | 76 | GNUNET_TRANSPORT_get_trait_peer_id (peer2_cmd, |
77 | &id); | 77 | &id); |
78 | GNUNET_TESTING_get_trait_hello (peer2_cmd, | 78 | GNUNET_TRANSPORT_get_trait_hello (peer2_cmd, |
79 | &hello); | 79 | &hello); |
80 | GNUNET_TESTING_get_trait_hello_size (peer2_cmd, | 80 | GNUNET_TRANSPORT_get_trait_hello_size (peer2_cmd, |
81 | &hello_size); | 81 | &hello_size); |
82 | 82 | ||
83 | addr = GNUNET_HELLO_extract_address (hello, | 83 | addr = GNUNET_HELLO_extract_address (hello, |
@@ -108,11 +108,11 @@ connect_peers_finish (void *cls, | |||
108 | struct GNUNET_PeerIdentity *id; | 108 | struct GNUNET_PeerIdentity *id; |
109 | 109 | ||
110 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (cps->peer1_label); | 110 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (cps->peer1_label); |
111 | GNUNET_TESTING_get_trait_peer_id (peer1_cmd, | 111 | GNUNET_TRANSPORT_get_trait_peer_id (peer1_cmd, |
112 | &id); | 112 | &id); |
113 | 113 | ||
114 | peer2_cmd = GNUNET_TESTING_interpreter_lookup_command (cps->peer2_label); | 114 | peer2_cmd = GNUNET_TESTING_interpreter_lookup_command (cps->peer2_label); |
115 | GNUNET_TESTING_get_trait_connected_peers_map (peer2_cmd, | 115 | GNUNET_TRANSPORT_get_trait_connected_peers_map (peer2_cmd, |
116 | &connected_peers_map); | 116 | &connected_peers_map); |
117 | 117 | ||
118 | ret = GNUNET_CONTAINER_multipeermap_contains (connected_peers_map, | 118 | ret = GNUNET_CONTAINER_multipeermap_contains (connected_peers_map, |
diff --git a/src/transport/transport_api_cmd_send_simple.c b/src/transport/transport_api_cmd_send_simple.c index e4ac199d1..4a60f1a12 100644 --- a/src/transport/transport_api_cmd_send_simple.c +++ b/src/transport/transport_api_cmd_send_simple.c | |||
@@ -76,12 +76,12 @@ send_simple_run (void *cls, | |||
76 | const struct GNUNET_TESTING_Command *peer2_cmd; | 76 | const struct GNUNET_TESTING_Command *peer2_cmd; |
77 | 77 | ||
78 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (sss->peer1_label); | 78 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (sss->peer1_label); |
79 | GNUNET_TESTING_get_trait_connected_peers_map (peer1_cmd, | 79 | GNUNET_TRANSPORT_get_trait_connected_peers_map (peer1_cmd, |
80 | &connected_peers_map); | 80 | &connected_peers_map); |
81 | 81 | ||
82 | peer2_cmd = GNUNET_TESTING_interpreter_lookup_command (sss->peer2_label); | 82 | peer2_cmd = GNUNET_TESTING_interpreter_lookup_command (sss->peer2_label); |
83 | GNUNET_TESTING_get_trait_peer_id (peer2_cmd, | 83 | GNUNET_TRANSPORT_get_trait_peer_id (peer2_cmd, |
84 | &id); | 84 | &id); |
85 | 85 | ||
86 | mq = GNUNET_CONTAINER_multipeermap_get (connected_peers_map, | 86 | mq = GNUNET_CONTAINER_multipeermap_get (connected_peers_map, |
87 | id); | 87 | id); |
diff --git a/src/transport/transport_api_cmd_start_peer.c b/src/transport/transport_api_cmd_start_peer.c index 0ad9f99af..c9af497ae 100644 --- a/src/transport/transport_api_cmd_start_peer.c +++ b/src/transport/transport_api_cmd_start_peer.c | |||
@@ -445,10 +445,10 @@ start_peer_traits (void *cls, | |||
445 | } | 445 | } |
446 | 446 | ||
447 | int | 447 | int |
448 | GNUNET_TESTING_get_trait_hello_size (const struct | 448 | GNUNET_TRANSPORT_get_trait_hello_size (const struct |
449 | GNUNET_TESTING_Command | 449 | GNUNET_TESTING_Command |
450 | *cmd, | 450 | *cmd, |
451 | size_t **hello_size) | 451 | size_t **hello_size) |
452 | { | 452 | { |
453 | return cmd->traits (cmd->cls, | 453 | return cmd->traits (cmd->cls, |
454 | (const void **) hello_size, | 454 | (const void **) hello_size, |
@@ -457,10 +457,10 @@ GNUNET_TESTING_get_trait_hello_size (const struct | |||
457 | } | 457 | } |
458 | 458 | ||
459 | int | 459 | int |
460 | GNUNET_TESTING_get_trait_hello (const struct | 460 | GNUNET_TRANSPORT_get_trait_hello (const struct |
461 | GNUNET_TESTING_Command | 461 | GNUNET_TESTING_Command |
462 | *cmd, | 462 | *cmd, |
463 | char **hello) | 463 | char **hello) |
464 | { | 464 | { |
465 | return cmd->traits (cmd->cls, | 465 | return cmd->traits (cmd->cls, |
466 | (const void **) hello, | 466 | (const void **) hello, |
@@ -469,12 +469,12 @@ GNUNET_TESTING_get_trait_hello (const struct | |||
469 | } | 469 | } |
470 | 470 | ||
471 | int | 471 | int |
472 | GNUNET_TESTING_get_trait_connected_peers_map (const struct | 472 | GNUNET_TRANSPORT_get_trait_connected_peers_map (const struct |
473 | GNUNET_TESTING_Command | 473 | GNUNET_TESTING_Command |
474 | *cmd, | 474 | *cmd, |
475 | struct | 475 | struct |
476 | GNUNET_CONTAINER_MultiPeerMap ** | 476 | GNUNET_CONTAINER_MultiPeerMap ** |
477 | connected_peers_map) | 477 | connected_peers_map) |
478 | { | 478 | { |
479 | return cmd->traits (cmd->cls, | 479 | return cmd->traits (cmd->cls, |
480 | (const void **) connected_peers_map, | 480 | (const void **) connected_peers_map, |
@@ -498,9 +498,9 @@ GNUNET_TRANSPORT_get_trait_application_handle (const struct | |||
498 | 498 | ||
499 | 499 | ||
500 | int | 500 | int |
501 | GNUNET_TESTING_get_trait_peer_id (const struct | 501 | GNUNET_TRANSPORT_get_trait_peer_id (const struct |
502 | GNUNET_TESTING_Command *cmd, | 502 | GNUNET_TESTING_Command *cmd, |
503 | struct GNUNET_PeerIdentity **id) | 503 | struct GNUNET_PeerIdentity **id) |
504 | { | 504 | { |
505 | return cmd->traits (cmd->cls, | 505 | return cmd->traits (cmd->cls, |
506 | (const void **) id, | 506 | (const void **) id, |