aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_testing_ng_lib.h25
-rw-r--r--src/include/gnunet_transport_service.h14
-rw-r--r--src/testbed/Makefile.am1
-rwxr-xr-xsrc/testbed/netjail_exec.sh2
-rwxr-xr-xsrc/testbed/netjail_start.sh2
-rwxr-xr-xsrc/testbed/netjail_stop.sh2
-rw-r--r--src/testbed/testbed_api_cmd_netjail_start.c2
-rw-r--r--src/testbed/testbed_api_cmd_netjail_start_testbed.c24
-rw-r--r--src/testbed/testbed_api_cmd_netjail_stop.c2
-rw-r--r--src/testing/testing_api_cmd_system_create.c5
-rw-r--r--src/transport/Makefile.am28
-rw-r--r--src/transport/plugin_cmd_simple_send.c74
-rw-r--r--src/transport/test_transport_api_cmd_simple_send.c8
-rw-r--r--src/transport/transport-testing2.h37
-rw-r--r--src/transport/transport_api_cmd_connecting_peers.c14
-rw-r--r--src/transport/transport_api_cmd_send_simple.c8
-rw-r--r--src/transport/transport_api_cmd_start_peer.c34
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
837int
838GNUNET_TESTING_get_trait_peer_id (const struct
839 GNUNET_TESTING_Command *cmd,
840 struct GNUNET_PeerIdentity **id);
841
842int
843GNUNET_TESTING_get_trait_connected_peers_map (const struct
844 GNUNET_TESTING_Command
845 *cmd,
846 struct
847 GNUNET_CONTAINER_MultiPeerMap **
848 connected_peers_map);
849int
850GNUNET_TESTING_get_trait_hello_size (const struct
851 GNUNET_TESTING_Command
852 *cmd,
853 size_t **hello_size);
854
855int
856GNUNET_TESTING_get_trait_hello (const struct
857 GNUNET_TESTING_Command
858 *cmd,
859 char **hello);
860
861int 836int
862GNUNET_TESTING_get_trait_test_system (const struct 837GNUNET_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
689struct GNUNET_TESTING_Command
690GNUNET_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
697struct GNUNET_TESTING_Command
698GNUNET_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 = \
101gnunet_cmds_helper_LDADD = $(XLIB) \ 101gnunet_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
4set -eu 4set -eu
5set -x 5set -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
4set -eu 4set -eu
5set -x 5set -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
4set -eu 4set -eu
5set -x 5set -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
33struct NetJailState 33struct 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
35struct HelperMessage; 35struct HelperMessage;
36 36
@@ -319,15 +319,15 @@ create_helper_init_msg_ (char *m_char,
319static void 319static void
320start_testbed (struct NetJailState *ns, struct 320start_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
34struct GNUNET_ChildWaitHandle *cwh; 34struct 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
52static int 57static 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 = \ 403libgnunet_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 = \ 405libgnunet_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 = \ 412libgnunet_plugin_cmd_simple_send_la_LDFLAGS = \
413# $(GN_PLUGIN_LDFLAGS) 413 $(GN_PLUGIN_LDFLAGS)
414 414
415if HAVE_EXPERIMENTAL 415if HAVE_EXPERIMENTAL
416plugin_LTLIBRARIES += libgnunet_plugin_transport_udp.la 416plugin_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
39struct GNUNET_MQ_MessageHandler *handlers; 41struct GNUNET_MQ_MessageHandler *handlers;
40 42
41const char *cfgname;
42
43unsigned int are_all_peers_started; 43unsigned int are_all_peers_started;
44 44
45static int
46check_test (void *cls,
47 const struct GNUNET_TRANSPORT_TESTING_TestMessage *message)
48{
49 return GNUNET_OK;
50}
51
52static void
53handle_test (void *cls,
54 const struct GNUNET_TRANSPORT_TESTING_TestMessage *message)
55{
56 LOG (GNUNET_ERROR_TYPE_ERROR,
57 "message received\n");
58}
59
60static int
61check_test2 (void *cls,
62 const struct GNUNET_TRANSPORT_TESTING_TestMessage *message)
63{
64 return GNUNET_OK;
65}
66
67static void
68handle_test2 (void *cls,
69 const struct GNUNET_TRANSPORT_TESTING_TestMessage *message)
70{
71 LOG (GNUNET_ERROR_TYPE_ERROR,
72 "message received\n");
73}
74
45static void 75static void
46all_peers_started () 76all_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 */
108void * 160void *
109libgnunet_plugin_testcmd_init (void *cls) 161libgnunet_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 */
126void * 178void *
127libgnunet_plugin_testcmd_done (void *cls) 179libgnunet_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,
920char * 920char *
921GNUNET_TRANSPORT_TESTING_get_test_source_name (const char *file); 921GNUNET_TRANSPORT_TESTING_get_test_source_name (const char *file);
922 922
923struct GNUNET_TESTING_Command
924GNUNET_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
931struct GNUNET_TESTING_Command
932GNUNET_TRANSPORT_cmd_connect_peers (const char *label,
933 const char *peer1_label,
934 const char *peer2_label);
935
936int
937GNUNET_TRANSPORT_get_trait_peer_id (const struct
938 GNUNET_TESTING_Command *cmd,
939 struct GNUNET_PeerIdentity **id);
940
941int
942GNUNET_TRANSPORT_get_trait_connected_peers_map (const struct
943 GNUNET_TESTING_Command
944 *cmd,
945 struct
946 GNUNET_CONTAINER_MultiPeerMap **
947 connected_peers_map);
948int
949GNUNET_TRANSPORT_get_trait_hello_size (const struct
950 GNUNET_TESTING_Command
951 *cmd,
952 size_t **hello_size);
953
954int
955GNUNET_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
447int 447int
448GNUNET_TESTING_get_trait_hello_size (const struct 448GNUNET_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
459int 459int
460GNUNET_TESTING_get_trait_hello (const struct 460GNUNET_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
471int 471int
472GNUNET_TESTING_get_trait_connected_peers_map (const struct 472GNUNET_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
500int 500int
501GNUNET_TESTING_get_trait_peer_id (const struct 501GNUNET_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,