diff options
author | t3sserakt <t3ss@posteo.de> | 2023-10-02 18:10:36 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2023-10-02 18:10:36 +0200 |
commit | 1016d6d193b1af38f90999de25854593c77364a8 (patch) | |
tree | 0eb47530e45cc7b046c672b4c6b8fa76778db35a /src | |
parent | 02a1fdad33c37bf39d4bdbe4c535fcf4c6ed0cc4 (diff) | |
download | gnunet-1016d6d193b1af38f90999de25854593c77364a8.tar.gz gnunet-1016d6d193b1af38f90999de25854593c77364a8.zip |
NEWS: Code moved to the core package to get rid of circular dependencies.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/Makefile.am | 90 | ||||
-rw-r--r-- | src/core/core_api_cmd_connecting_peers.c | 275 | ||||
-rw-r--r-- | src/core/test_core_plugin_cmd_just_run.c | 512 | ||||
-rwxr-xr-x | src/core/test_core_start_testcase.sh | 15 | ||||
-rw-r--r-- | src/include/gnunet_testing_ng_lib.h | 91 | ||||
-rw-r--r-- | src/transport/Makefile.am | 20 | ||||
-rw-r--r-- | src/transport/test_transport_api2_tng_node.conf | 9 | ||||
-rw-r--r-- | src/transport/test_transport_start_with_config.c | 1 |
8 files changed, 947 insertions, 66 deletions
diff --git a/src/core/Makefile.am b/src/core/Makefile.am index cad234abd..1343fe395 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am | |||
@@ -3,6 +3,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/include | |||
3 | 3 | ||
4 | pkgcfgdir= $(pkgdatadir)/config.d/ | 4 | pkgcfgdir= $(pkgdatadir)/config.d/ |
5 | 5 | ||
6 | plugindir = $(libdir)/gnunet | ||
7 | |||
6 | libexecdir= $(pkglibdir)/libexec/ | 8 | libexecdir= $(pkglibdir)/libexec/ |
7 | 9 | ||
8 | pkgcfg_DATA = \ | 10 | pkgcfg_DATA = \ |
@@ -13,9 +15,15 @@ if USE_COVERAGE | |||
13 | XLIB = -lgcov | 15 | XLIB = -lgcov |
14 | endif | 16 | endif |
15 | 17 | ||
18 | plugin_LTLIBRARIES = \ | ||
19 | libgnunet_test_core_plugin_cmd_just_run.la | ||
20 | |||
21 | TESTING_LIBS = \ | ||
22 | libgnunetcoretesting.la | ||
16 | 23 | ||
17 | lib_LTLIBRARIES = \ | 24 | lib_LTLIBRARIES = \ |
18 | libgnunetcore.la | 25 | libgnunetcore.la \ |
26 | $(TESTING_LIBS) | ||
19 | 27 | ||
20 | libgnunetcore_la_SOURCES = \ | 28 | libgnunetcore_la_SOURCES = \ |
21 | core_api.c core.h \ | 29 | core_api.c core.h \ |
@@ -27,6 +35,35 @@ libgnunetcore_la_LDFLAGS = \ | |||
27 | $(GN_LIB_LDFLAGS) \ | 35 | $(GN_LIB_LDFLAGS) \ |
28 | -version-info 0:1:0 | 36 | -version-info 0:1:0 |
29 | 37 | ||
38 | libgnunet_test_core_plugin_cmd_just_run_la_SOURCES = \ | ||
39 | test_core_plugin_cmd_just_run.c | ||
40 | libgnunet_test_core_plugin_cmd_just_run_la_LIBADD = \ | ||
41 | $(top_builddir)/src/transport/libgnunettransportapplication.la \ | ||
42 | $(top_builddir)/src/transport/libgnunettransportcore.la \ | ||
43 | $(top_builddir)/src/testing/libgnunettesting.la \ | ||
44 | $(top_builddir)/src/peerstore/libgnunetpeerstore.la \ | ||
45 | $(top_builddir)/src/core/libgnunetcoretesting.la \ | ||
46 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | ||
47 | $(top_builddir)/src/hello/libgnunethello.la \ | ||
48 | $(top_builddir)/src/ats/libgnunetats.la \ | ||
49 | $(top_builddir)/src/arm/libgnunetarm.la \ | ||
50 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
51 | $(LTLIBINTL) | ||
52 | libgnunet_test_core_plugin_cmd_just_run_la_LDFLAGS = \ | ||
53 | $(GN_PLUGIN_LDFLAGS) | ||
54 | |||
55 | libgnunetcoretesting_la_SOURCES = \ | ||
56 | core_api_cmd_connecting_peers.c | ||
57 | libgnunetcoretesting_la_LIBADD = \ | ||
58 | $(top_builddir)/src/testing/libgnunettesting.la \ | ||
59 | $(top_builddir)/src/transport/libgnunettransportapplication.la \ | ||
60 | $(top_builddir)/src/transport/libgnunettransportcore.la \ | ||
61 | $(top_builddir)/src/util/libgnunetutil.la | ||
62 | libgnunetcoretesting_la_LDFLAGS = \ | ||
63 | $(GN_LIBINTL) \ | ||
64 | $(GN_LIB_LDFLAGS) \ | ||
65 | -version-info 0:0:0 | ||
66 | |||
30 | 67 | ||
31 | libexec_PROGRAMS = \ | 68 | libexec_PROGRAMS = \ |
32 | gnunet-service-core | 69 | gnunet-service-core |
@@ -60,32 +97,18 @@ TESTING_TESTS = \ | |||
60 | 97 | ||
61 | check_PROGRAMS = \ | 98 | check_PROGRAMS = \ |
62 | test_core_api_start_only \ | 99 | test_core_api_start_only \ |
63 | test_core_api \ | ||
64 | test_core_api_reliability \ | ||
65 | test_core_quota_compliance_symmetric \ | ||
66 | test_core_quota_compliance_asymmetric_send_limited \ | ||
67 | test_core_quota_compliance_asymmetric_recv_limited \ | ||
68 | $(TESTING_TESTS) | 100 | $(TESTING_TESTS) |
69 | 101 | ||
102 | # Only test TNG if we run experimental | ||
103 | check_SCRIPTS= \ | ||
104 | test_core_start_testcase.sh | ||
105 | |||
70 | if ENABLE_TEST_RUN | 106 | if ENABLE_TEST_RUN |
71 | AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME; | 107 | AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME; |
72 | TESTS = $(check_PROGRAMS) | 108 | TESTS = $(check_PROGRAMS) \ |
109 | $(check_SCRIPTS) | ||
73 | endif | 110 | endif |
74 | 111 | ||
75 | test_core_api_SOURCES = \ | ||
76 | test_core_api.c | ||
77 | test_core_api_LDADD = \ | ||
78 | libgnunetcore.la \ | ||
79 | $(top_builddir)/src/ats/libgnunetats.la \ | ||
80 | $(top_builddir)/src/util/libgnunetutil.la | ||
81 | |||
82 | test_core_api_reliability_SOURCES = \ | ||
83 | test_core_api_reliability.c | ||
84 | test_core_api_reliability_LDADD = \ | ||
85 | libgnunetcore.la \ | ||
86 | $(top_builddir)/src/ats/libgnunetats.la \ | ||
87 | $(top_builddir)/src/util/libgnunetutil.la | ||
88 | |||
89 | test_core_api_send_to_self_SOURCES = \ | 112 | test_core_api_send_to_self_SOURCES = \ |
90 | test_core_api_send_to_self.c | 113 | test_core_api_send_to_self.c |
91 | test_core_api_send_to_self_LDADD = \ | 114 | test_core_api_send_to_self_LDADD = \ |
@@ -100,31 +123,8 @@ test_core_api_start_only_LDADD = \ | |||
100 | libgnunetcore.la \ | 123 | libgnunetcore.la \ |
101 | $(top_builddir)/src/util/libgnunetutil.la | 124 | $(top_builddir)/src/util/libgnunetutil.la |
102 | 125 | ||
103 | test_core_quota_compliance_symmetric_SOURCES = \ | ||
104 | test_core_quota_compliance.c | ||
105 | test_core_quota_compliance_symmetric_LDADD = \ | ||
106 | libgnunetcore.la \ | ||
107 | $(top_builddir)/src/ats/libgnunetats.la \ | ||
108 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
109 | $(top_builddir)/src/statistics/libgnunetstatistics.la | ||
110 | |||
111 | test_core_quota_compliance_asymmetric_send_limited_SOURCES = \ | ||
112 | test_core_quota_compliance.c | ||
113 | test_core_quota_compliance_asymmetric_send_limited_LDADD = \ | ||
114 | libgnunetcore.la \ | ||
115 | $(top_builddir)/src/ats/libgnunetats.la \ | ||
116 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
117 | $(top_builddir)/src/statistics/libgnunetstatistics.la | ||
118 | |||
119 | test_core_quota_compliance_asymmetric_recv_limited_SOURCES = \ | ||
120 | test_core_quota_compliance.c | ||
121 | test_core_quota_compliance_asymmetric_recv_limited_LDADD = \ | ||
122 | libgnunetcore.la \ | ||
123 | $(top_builddir)/src/ats/libgnunetats.la \ | ||
124 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
125 | $(top_builddir)/src/statistics/libgnunetstatistics.la | ||
126 | |||
127 | EXTRA_DIST = \ | 126 | EXTRA_DIST = \ |
127 | test_core_start_testcase.sh \ | ||
128 | test_core_defaults.conf \ | 128 | test_core_defaults.conf \ |
129 | test_core_api_data.conf \ | 129 | test_core_api_data.conf \ |
130 | test_core_api_peer1.conf \ | 130 | test_core_api_peer1.conf \ |
diff --git a/src/core/core_api_cmd_connecting_peers.c b/src/core/core_api_cmd_connecting_peers.c new file mode 100644 index 000000000..ce2184a3c --- /dev/null +++ b/src/core/core_api_cmd_connecting_peers.c | |||
@@ -0,0 +1,275 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file testing_api_cmd_start_peer.c | ||
23 | * @brief cmd to start a peer. | ||
24 | * @author t3sserakt | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_util_lib.h" | ||
28 | #include "gnunet_testing_ng_lib.h" | ||
29 | #include "gnunet_testing_netjail_lib.h" | ||
30 | #include "gnunet_transport_application_service.h" | ||
31 | #include "gnunet_hello_lib.h" | ||
32 | #include "gnunet_transport_core_service.h" | ||
33 | |||
34 | /** | ||
35 | * Generic logging shortcut | ||
36 | */ | ||
37 | #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) | ||
38 | |||
39 | |||
40 | /** | ||
41 | * The run method of this cmd will connect to peers. | ||
42 | * | ||
43 | */ | ||
44 | static void | ||
45 | connect_peers_run (void *cls, | ||
46 | struct GNUNET_TESTING_Interpreter *is) | ||
47 | { | ||
48 | struct GNUNET_TESTING_ConnectPeersState *cps = cls; | ||
49 | const struct GNUNET_TESTING_StartPeerState *sps; | ||
50 | const struct GNUNET_TESTING_Command *system_cmd; | ||
51 | const struct GNUNET_TESTING_System *tl_system; | ||
52 | const struct GNUNET_TESTING_Command *peer1_cmd; | ||
53 | struct GNUNET_PeerIdentity *peer; | ||
54 | enum GNUNET_NetworkType nt = 0; | ||
55 | struct GNUNET_TESTING_NodeConnection *pos_connection; | ||
56 | struct GNUNET_TESTING_AddressPrefix *pos_prefix; | ||
57 | const enum GNUNET_GenericReturnValue *broadcast; | ||
58 | unsigned int con_num = 0; | ||
59 | uint32_t num; | ||
60 | char *addr; | ||
61 | char *addr_and_port; | ||
62 | char *emsg = NULL; | ||
63 | |||
64 | cps->is = is; | ||
65 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | ||
66 | cps->start_peer_label); | ||
67 | GNUNET_TESTING_get_trait_broadcast (peer1_cmd, | ||
68 | &broadcast); | ||
69 | GNUNET_TESTING_get_trait_state (peer1_cmd, | ||
70 | &sps); | ||
71 | |||
72 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | ||
73 | cps->create_label); | ||
74 | GNUNET_TESTING_get_trait_test_system (system_cmd, | ||
75 | &tl_system); | ||
76 | |||
77 | cps->tl_system = tl_system; | ||
78 | |||
79 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
80 | "cps->num: %u \n", | ||
81 | cps->num); | ||
82 | |||
83 | |||
84 | cps->ah = GNUNET_TRANSPORT_application_init (sps->cfg); | ||
85 | if (NULL == cps->ah) | ||
86 | { | ||
87 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
88 | "Failed to initialize the TRANSPORT application suggestion client handle for peer `%s': `%s'\n", | ||
89 | sps->cfgname, | ||
90 | emsg); | ||
91 | GNUNET_free (emsg); | ||
92 | GNUNET_TESTING_interpreter_fail (is); | ||
93 | return; | ||
94 | } | ||
95 | |||
96 | cps->node_connections_head = GNUNET_TESTING_get_connections (cps->num, | ||
97 | cps->topology); | ||
98 | |||
99 | for (pos_connection = cps->node_connections_head; NULL != pos_connection; | ||
100 | pos_connection = pos_connection->next) | ||
101 | { | ||
102 | con_num++; | ||
103 | num = GNUNET_TESTING_calculate_num (pos_connection, cps->topology); | ||
104 | for (pos_prefix = pos_connection->address_prefixes_head; NULL != pos_prefix; | ||
105 | pos_prefix = | ||
106 | pos_prefix->next) | ||
107 | { | ||
108 | addr = GNUNET_TESTING_get_address (pos_connection, | ||
109 | pos_prefix->address_prefix); | ||
110 | if (NULL != addr) | ||
111 | { | ||
112 | char *natted_p = strstr (pos_prefix->address_prefix, "_"); | ||
113 | |||
114 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
115 | "0 validating peer number %s %s %s\n", | ||
116 | natted_p, | ||
117 | pos_prefix->address_prefix, | ||
118 | addr); | ||
119 | if (0 == GNUNET_memcmp (pos_prefix->address_prefix, "udp")) | ||
120 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
121 | "validating memcmp\n"); | ||
122 | if (GNUNET_YES == *broadcast) | ||
123 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
124 | "validating broadcast\n"); | ||
125 | if ((0 == GNUNET_memcmp (pos_prefix->address_prefix, "udp")) && | ||
126 | (GNUNET_YES == *broadcast) ) | ||
127 | GNUNET_asprintf (&addr_and_port, | ||
128 | "%s:2086", | ||
129 | addr); | ||
130 | else if (NULL == natted_p) | ||
131 | GNUNET_asprintf (&addr_and_port, | ||
132 | "%s:60002", | ||
133 | addr); | ||
134 | else if (NULL != natted_p) | ||
135 | { | ||
136 | char *prefix; | ||
137 | char *rest; | ||
138 | char *rest2; | ||
139 | char *address; | ||
140 | |||
141 | prefix = strtok (addr, "_"); | ||
142 | rest = strtok (NULL, "_"); | ||
143 | rest2 = strtok (rest, "-"); | ||
144 | address = strtok (NULL, "-"); | ||
145 | |||
146 | GNUNET_asprintf (&addr_and_port, | ||
147 | "%s-%s:0", | ||
148 | prefix, | ||
149 | address); | ||
150 | |||
151 | } | ||
152 | peer = GNUNET_TESTING_get_peer (num, tl_system); | ||
153 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
154 | "validating peer number %u with identity %s and address %s %u %s and handle %p\n", | ||
155 | num, | ||
156 | GNUNET_i2s (peer), | ||
157 | addr_and_port, | ||
158 | *broadcast, | ||
159 | pos_prefix->address_prefix, | ||
160 | cps->ah); | ||
161 | GNUNET_TRANSPORT_application_validate ((struct | ||
162 | GNUNET_TRANSPORT_ApplicationHandle | ||
163 | *) cps->ah, | ||
164 | peer, | ||
165 | nt, | ||
166 | addr_and_port); | ||
167 | GNUNET_free (peer); | ||
168 | GNUNET_free (addr); | ||
169 | GNUNET_free (addr_and_port); | ||
170 | } | ||
171 | } | ||
172 | } | ||
173 | cps->con_num = con_num; | ||
174 | } | ||
175 | |||
176 | |||
177 | /** | ||
178 | * The cleanup function of this cmd frees resources the cmd allocated. | ||
179 | * | ||
180 | */ | ||
181 | static void | ||
182 | connect_peers_cleanup (void *cls) | ||
183 | { | ||
184 | struct GNUNET_TESTING_ConnectPeersState *cps = cls; | ||
185 | |||
186 | GNUNET_free (cps->connected_peers_map); | ||
187 | GNUNET_free (cps); | ||
188 | } | ||
189 | |||
190 | |||
191 | /** | ||
192 | * This function prepares an array with traits. | ||
193 | * | ||
194 | */ | ||
195 | enum GNUNET_GenericReturnValue | ||
196 | connect_peers_traits (void *cls, | ||
197 | const void **ret, | ||
198 | const char *trait, | ||
199 | unsigned int index) | ||
200 | { | ||
201 | struct GNUNET_TESTING_ConnectPeersState *cps = cls; | ||
202 | struct GNUNET_TESTING_Trait traits[] = { | ||
203 | GNUNET_TESTING_make_trait_connect_peer_state ((const void *) cps), | ||
204 | GNUNET_TESTING_trait_end () | ||
205 | }; | ||
206 | return GNUNET_TESTING_get_trait (traits, | ||
207 | ret, | ||
208 | trait, | ||
209 | index); | ||
210 | } | ||
211 | |||
212 | |||
213 | struct GNUNET_TESTING_Command | ||
214 | GNUNET_CORE_cmd_connect_peers (const char *label, | ||
215 | const char *start_peer_label, | ||
216 | const char *create_label, | ||
217 | uint32_t num, | ||
218 | struct GNUNET_TESTING_NetjailTopology * | ||
219 | topology, | ||
220 | unsigned int additional_connects, | ||
221 | unsigned int wait_for_connect, | ||
222 | struct GNUNET_MQ_MessageHandler *handlers) | ||
223 | { | ||
224 | struct GNUNET_TESTING_ConnectPeersState *cps; | ||
225 | unsigned int node_additional_connects; | ||
226 | struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map = | ||
227 | GNUNET_CONTAINER_multishortmap_create (1,GNUNET_NO); | ||
228 | unsigned int i; | ||
229 | |||
230 | node_additional_connects = GNUNET_TESTING_get_additional_connects (num, | ||
231 | topology); | ||
232 | |||
233 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
234 | "global: %u and local: %u additional_connects\n", | ||
235 | additional_connects, | ||
236 | node_additional_connects); | ||
237 | |||
238 | if (0 != node_additional_connects) | ||
239 | additional_connects = node_additional_connects; | ||
240 | |||
241 | cps = GNUNET_new (struct GNUNET_TESTING_ConnectPeersState); | ||
242 | cps->start_peer_label = start_peer_label; | ||
243 | cps->num = num; | ||
244 | cps->create_label = create_label; | ||
245 | cps->topology = topology; | ||
246 | cps->additional_connects = additional_connects; | ||
247 | cps->wait_for_connect = wait_for_connect; | ||
248 | cps->connected_peers_map = connected_peers_map; | ||
249 | |||
250 | if (NULL != handlers) | ||
251 | { | ||
252 | for (i = 0; NULL != handlers[i].cb; i++) | ||
253 | ; | ||
254 | cps->handlers = GNUNET_new_array (i + 1, | ||
255 | struct GNUNET_MQ_MessageHandler); | ||
256 | GNUNET_memcpy (cps->handlers, | ||
257 | handlers, | ||
258 | i * sizeof(struct GNUNET_MQ_MessageHandler)); | ||
259 | } | ||
260 | |||
261 | if (GNUNET_YES == wait_for_connect) | ||
262 | return GNUNET_TESTING_command_new (cps, | ||
263 | label, | ||
264 | &connect_peers_run, | ||
265 | &connect_peers_cleanup, | ||
266 | &connect_peers_traits, | ||
267 | &cps->ac); | ||
268 | else | ||
269 | return GNUNET_TESTING_command_new (cps, | ||
270 | label, | ||
271 | &connect_peers_run, | ||
272 | &connect_peers_cleanup, | ||
273 | &connect_peers_traits, | ||
274 | NULL); | ||
275 | } | ||
diff --git a/src/core/test_core_plugin_cmd_just_run.c b/src/core/test_core_plugin_cmd_just_run.c new file mode 100644 index 000000000..176d055c8 --- /dev/null +++ b/src/core/test_core_plugin_cmd_just_run.c | |||
@@ -0,0 +1,512 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file testbed/plugin_cmd_simple_send.c | ||
23 | * @brief a plugin to provide the API for running test cases. | ||
24 | * @author t3sserakt | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_testing_barrier.h" | ||
28 | #include "gnunet_testing_netjail_lib.h" | ||
29 | #include "gnunet_util_lib.h" | ||
30 | #include "gnunet_transport_application_service.h" | ||
31 | #include "gnunet_transport_core_service.h" | ||
32 | #include "gnunet_testing_barrier.h" | ||
33 | #include "gnunet_core_service.h" | ||
34 | #include "gnunet_transport_testing_ng_lib.h" | ||
35 | |||
36 | /** | ||
37 | * Generic logging shortcut | ||
38 | */ | ||
39 | #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) | ||
40 | |||
41 | #define BASE_DIR "testdir" | ||
42 | |||
43 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) | ||
44 | |||
45 | #define MAX_RECEIVED 1000 | ||
46 | |||
47 | #define MESSAGE_SIZE 65000 | ||
48 | |||
49 | static struct GNUNET_TESTING_Command block_script; | ||
50 | |||
51 | static struct GNUNET_TESTING_Command connect_peers; | ||
52 | |||
53 | static struct GNUNET_TESTING_Command local_prepared; | ||
54 | |||
55 | static struct GNUNET_TESTING_Command start_peer; | ||
56 | |||
57 | static struct GNUNET_TESTING_Interpreter *is; | ||
58 | |||
59 | static struct GNUNET_CONTAINER_MultiPeerMap *senders; | ||
60 | |||
61 | struct TestState | ||
62 | { | ||
63 | /** | ||
64 | * Callback to write messages to the master loop. | ||
65 | * | ||
66 | */ | ||
67 | GNUNET_TESTING_cmd_helper_write_cb write_message; | ||
68 | |||
69 | /** | ||
70 | * Callback to notify the helper test case has finished. | ||
71 | */ | ||
72 | GNUNET_TESTING_cmd_helper_finish_cb finished_cb; | ||
73 | |||
74 | /** | ||
75 | * The name for a specific test environment directory. | ||
76 | * | ||
77 | */ | ||
78 | char *testdir; | ||
79 | |||
80 | /** | ||
81 | * The name for the configuration file of the specific node. | ||
82 | * | ||
83 | */ | ||
84 | char *cfgname; | ||
85 | |||
86 | /** | ||
87 | * The complete topology information. | ||
88 | */ | ||
89 | struct GNUNET_TESTING_NetjailTopology *topology; | ||
90 | }; | ||
91 | |||
92 | struct Sender | ||
93 | { | ||
94 | /** | ||
95 | * Number of received messages from sender. | ||
96 | */ | ||
97 | unsigned long long num_received; | ||
98 | |||
99 | /** | ||
100 | * Sample mean time the message traveled. | ||
101 | */ | ||
102 | struct GNUNET_TIME_Relative mean_time; | ||
103 | |||
104 | /** | ||
105 | * Time the first message was send. | ||
106 | */ | ||
107 | struct GNUNET_TIME_Absolute time_first; | ||
108 | }; | ||
109 | |||
110 | |||
111 | struct GNUNET_TESTING_BarrierList* | ||
112 | get_waiting_for_barriers () | ||
113 | { | ||
114 | struct GNUNET_TESTING_BarrierList*barriers; | ||
115 | struct GNUNET_TESTING_BarrierListEntry *ble; | ||
116 | |||
117 | barriers = GNUNET_new (struct GNUNET_TESTING_BarrierList); | ||
118 | ble = GNUNET_new (struct GNUNET_TESTING_BarrierListEntry); | ||
119 | ble->barrier_name = "ready-to-connect"; | ||
120 | ble->expected_reaches = 1; | ||
121 | GNUNET_CONTAINER_DLL_insert (barriers->head, | ||
122 | barriers->tail, | ||
123 | ble); | ||
124 | |||
125 | ble = GNUNET_new (struct GNUNET_TESTING_BarrierListEntry); | ||
126 | ble->barrier_name = "test-case-finished"; | ||
127 | ble->expected_reaches = 1; | ||
128 | GNUNET_CONTAINER_DLL_insert (barriers->head, | ||
129 | barriers->tail, | ||
130 | ble); | ||
131 | return barriers; | ||
132 | } | ||
133 | |||
134 | |||
135 | /** | ||
136 | * Callback to set the flag indicating all peers started. Will be called via the plugin api. | ||
137 | * | ||
138 | */ | ||
139 | static void | ||
140 | all_peers_started () | ||
141 | { | ||
142 | } | ||
143 | |||
144 | |||
145 | /** | ||
146 | * Function called with the final result of the test. | ||
147 | * | ||
148 | * @param cls the `struct MainParams` | ||
149 | * @param rv #GNUNET_OK if the test passed | ||
150 | */ | ||
151 | static void | ||
152 | handle_result (void *cls, | ||
153 | enum GNUNET_GenericReturnValue rv) | ||
154 | { | ||
155 | struct TestState *ts = cls; | ||
156 | |||
157 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
158 | "Local test exits with status %d\n", | ||
159 | rv); | ||
160 | |||
161 | ts->finished_cb (rv); | ||
162 | GNUNET_free (ts->testdir); | ||
163 | GNUNET_free (ts->cfgname); | ||
164 | GNUNET_TESTING_free_topology (ts->topology); | ||
165 | GNUNET_free (ts); | ||
166 | } | ||
167 | |||
168 | |||
169 | /** | ||
170 | * Callback from start peer cmd for signaling a peer got connected. | ||
171 | * | ||
172 | * | ||
173 | static void * | ||
174 | notify_connect (struct GNUNET_TESTING_Interpreter *is, | ||
175 | const struct GNUNET_PeerIdentity *peer) | ||
176 | { | ||
177 | const struct ConnectPeersState *cps; | ||
178 | const struct GNUNET_TESTING_Command *cmd; | ||
179 | |||
180 | cmd = GNUNET_TESTING_interpreter_lookup_command (is, | ||
181 | "connect-peers"); | ||
182 | GNUNET_TRANSPORT_get_trait_connect_peer_state (cmd, | ||
183 | &cps); | ||
184 | void *ret = NULL; | ||
185 | |||
186 | cps->notify_connect (is, | ||
187 | peer); | ||
188 | return ret; | ||
189 | }*/ | ||
190 | |||
191 | |||
192 | /** | ||
193 | * Callback to set the flag indicating all peers are prepared to finish. Will be called via the plugin api. | ||
194 | */ | ||
195 | static void | ||
196 | all_local_tests_prepared () | ||
197 | { | ||
198 | const struct GNUNET_TESTING_LocalPreparedState *lfs; | ||
199 | |||
200 | GNUNET_TESTING_get_trait_local_prepared_state (&local_prepared, | ||
201 | &lfs); | ||
202 | GNUNET_assert (NULL != &lfs->ac); | ||
203 | if (NULL == lfs->ac.cont) | ||
204 | GNUNET_TESTING_async_fail ((struct GNUNET_TESTING_AsyncContext *) &lfs->ac); | ||
205 | else | ||
206 | GNUNET_TESTING_async_finish ((struct | ||
207 | GNUNET_TESTING_AsyncContext *) &lfs->ac); | ||
208 | } | ||
209 | |||
210 | |||
211 | static void | ||
212 | child_completed_callback (void *cls, | ||
213 | enum GNUNET_OS_ProcessStatusType type, | ||
214 | long unsigned int exit_code) | ||
215 | { | ||
216 | |||
217 | } | ||
218 | |||
219 | |||
220 | /** | ||
221 | * Function called to check a message being | ||
222 | * received. | ||
223 | * | ||
224 | */ | ||
225 | static int | ||
226 | check_encrypted (void *cls, struct GNUNET_MessageHeader *header) | ||
227 | { | ||
228 | return GNUNET_OK; | ||
229 | } | ||
230 | |||
231 | |||
232 | static void | ||
233 | core_receive_continue (struct GNUNET_PeerIdentity *peer) | ||
234 | { | ||
235 | const struct GNUNET_TESTING_StartPeerState *sps; | ||
236 | |||
237 | GNUNET_TESTING_get_trait_state (&start_peer, | ||
238 | &sps); | ||
239 | |||
240 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
241 | "Executing core receive continue\n"); | ||
242 | |||
243 | GNUNET_TRANSPORT_core_receive_continue (sps->th, peer); | ||
244 | } | ||
245 | |||
246 | |||
247 | /*static void | ||
248 | handle_core (void *cls, struct GNUNET_MessageHeader *header) | ||
249 | { | ||
250 | struct GNUNET_PeerIdentity *peer = cls; | ||
251 | |||
252 | core_receive_continue (peer); | ||
253 | }*/ | ||
254 | |||
255 | |||
256 | /** | ||
257 | * Function called to handle a message being received. | ||
258 | * | ||
259 | */ | ||
260 | static void | ||
261 | handle_encrypted (void *cls, struct GNUNET_MessageHeader *header) | ||
262 | { | ||
263 | struct GNUNET_PeerIdentity *peer = cls; | ||
264 | |||
265 | core_receive_continue (peer); | ||
266 | } | ||
267 | |||
268 | |||
269 | static void | ||
270 | handle_ephemeral_key (void *cls, struct GNUNET_MessageHeader *header) | ||
271 | { | ||
272 | struct GNUNET_PeerIdentity *peer = cls; | ||
273 | |||
274 | core_receive_continue (peer); | ||
275 | } | ||
276 | |||
277 | |||
278 | static void | ||
279 | handle_ping (void *cls, struct GNUNET_MessageHeader *header) | ||
280 | { | ||
281 | struct GNUNET_PeerIdentity *peer = cls; | ||
282 | |||
283 | core_receive_continue (peer); | ||
284 | } | ||
285 | |||
286 | |||
287 | static void | ||
288 | handle_pong (void *cls, struct GNUNET_MessageHeader *header) | ||
289 | { | ||
290 | struct GNUNET_PeerIdentity *peer = cls; | ||
291 | |||
292 | core_receive_continue (peer); | ||
293 | } | ||
294 | |||
295 | |||
296 | /** | ||
297 | * Function to start a local test case. | ||
298 | * | ||
299 | * @param write_message Callback to send a message to the master loop. | ||
300 | * @param router_ip Global address of the network namespace. | ||
301 | * @param node_ip The IP address of the node. | ||
302 | * @param m The number of the node in a network namespace. | ||
303 | * @param n The number of the network namespace. | ||
304 | * @param local_m The number of nodes in a network namespace. | ||
305 | * @param topology_data A file name for the file containing the topology configuration, or a string containing | ||
306 | * the topology configuration. | ||
307 | * @param read_file If read_file is GNUNET_YES this string is the filename for the topology configuration, | ||
308 | * if read_file is GNUNET_NO the string contains the topology configuration. | ||
309 | * @param finish_cb Callback function which writes a message from the helper process running on a netjail | ||
310 | * node to the master process * signaling that the test case running on the netjail node finished. | ||
311 | * @return Returns the struct GNUNET_TESTING_Interpreter of the command loop running on this netjail node. | ||
312 | */ | ||
313 | static struct GNUNET_TESTING_Interpreter * | ||
314 | start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, | ||
315 | const char *router_ip, | ||
316 | const char *node_ip, | ||
317 | const char *m, | ||
318 | const char *n, | ||
319 | const char *local_m, | ||
320 | const char *topology_data, | ||
321 | unsigned int *read_file, | ||
322 | GNUNET_TESTING_cmd_helper_finish_cb finished_cb) | ||
323 | { | ||
324 | |||
325 | unsigned int n_int; | ||
326 | unsigned int m_int; | ||
327 | unsigned int local_m_int; | ||
328 | unsigned int num; | ||
329 | struct TestState *ts = GNUNET_new (struct TestState); | ||
330 | struct GNUNET_TESTING_NetjailTopology *topology; | ||
331 | unsigned int sscanf_ret = 0; | ||
332 | char **argv = NULL; | ||
333 | int argc = 0; | ||
334 | |||
335 | ts->finished_cb = finished_cb; | ||
336 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
337 | "n %s m %s\n", | ||
338 | n, | ||
339 | m); | ||
340 | |||
341 | if (GNUNET_YES == *read_file) | ||
342 | { | ||
343 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
344 | "read from file\n"); | ||
345 | topology = GNUNET_TESTING_get_topo_from_file (topology_data); | ||
346 | } | ||
347 | else | ||
348 | topology = GNUNET_TESTING_get_topo_from_string (topology_data); | ||
349 | |||
350 | ts->topology = topology; | ||
351 | |||
352 | errno = 0; | ||
353 | sscanf_ret = sscanf (m, "%u", &m_int); | ||
354 | if (errno != 0) | ||
355 | { | ||
356 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
357 | } | ||
358 | GNUNET_assert (0 < sscanf_ret); | ||
359 | errno = 0; | ||
360 | sscanf_ret = sscanf (n, "%u", &n_int); | ||
361 | if (errno != 0) | ||
362 | { | ||
363 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
364 | } | ||
365 | GNUNET_assert (0 < sscanf_ret); | ||
366 | errno = 0; | ||
367 | sscanf_ret = sscanf (local_m, "%u", &local_m_int); | ||
368 | if (errno != 0) | ||
369 | { | ||
370 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "sscanf"); | ||
371 | } | ||
372 | GNUNET_assert (0 < sscanf_ret); | ||
373 | |||
374 | if (0 == n_int) | ||
375 | num = m_int; | ||
376 | else | ||
377 | num = (n_int - 1) * local_m_int + m_int + topology->nodes_x; | ||
378 | |||
379 | block_script = GNUNET_TESTING_cmd_block_until_external_trigger ( | ||
380 | "block-script"); | ||
381 | connect_peers = GNUNET_CORE_cmd_connect_peers ("connect-peers", | ||
382 | "start-peer", | ||
383 | "system-create", | ||
384 | num, | ||
385 | topology, | ||
386 | 0, | ||
387 | GNUNET_NO, | ||
388 | NULL); | ||
389 | local_prepared = GNUNET_TESTING_cmd_local_test_prepared ( | ||
390 | "local-test-prepared", | ||
391 | write_message); | ||
392 | |||
393 | |||
394 | GNUNET_asprintf (&ts->cfgname, | ||
395 | "test_core_just_run.conf"); | ||
396 | |||
397 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
398 | "plugin cfgname: %s\n", | ||
399 | ts->cfgname); | ||
400 | |||
401 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
402 | "node ip: %s\n", | ||
403 | node_ip); | ||
404 | |||
405 | GNUNET_asprintf (&ts->testdir, | ||
406 | "%s%s%s", | ||
407 | BASE_DIR, | ||
408 | m, | ||
409 | n); | ||
410 | |||
411 | /*struct GNUNET_MQ_MessageHandler handlers[] = { | ||
412 | GNUNET_MQ_hd_fixed_size (ephemeral_key, | ||
413 | GNUNET_MESSAGE_TYPE_CORE_EPHEMERAL_KEY, | ||
414 | struct EphemeralKeyMessage, | ||
415 | NULL), | ||
416 | GNUNET_MQ_hd_fixed_size (ping, | ||
417 | GNUNET_MESSAGE_TYPE_CORE_PING, | ||
418 | struct PingMessage, | ||
419 | NULL), | ||
420 | GNUNET_MQ_hd_fixed_size (pong, | ||
421 | GNUNET_MESSAGE_TYPE_CORE_PONG, | ||
422 | struct PongMessage, | ||
423 | NULL), | ||
424 | GNUNET_MQ_handler_end () | ||
425 | };*/ | ||
426 | |||
427 | start_peer = GNUNET_TESTING_cmd_start_peer ("start-peer", | ||
428 | "system-create", | ||
429 | num, | ||
430 | node_ip, | ||
431 | ts->cfgname, | ||
432 | GNUNET_NO); | ||
433 | |||
434 | struct GNUNET_TESTING_Command commands[] = { | ||
435 | GNUNET_TESTING_cmd_system_create ("system-create", | ||
436 | ts->testdir), | ||
437 | start_peer, | ||
438 | GNUNET_TESTING_cmd_barrier_reached ("ready-to-connect-reached", | ||
439 | "ready-to-connect", | ||
440 | GNUNET_NO, | ||
441 | num, | ||
442 | GNUNET_NO, | ||
443 | write_message), | ||
444 | connect_peers, | ||
445 | GNUNET_TESTING_cmd_exec_bash_script ("script", | ||
446 | "block.sh", | ||
447 | argv, | ||
448 | argc, | ||
449 | &child_completed_callback), | ||
450 | block_script, | ||
451 | GNUNET_TESTING_cmd_barrier_reached ("test-case-finished-reached", | ||
452 | "test-case-finished", | ||
453 | GNUNET_NO, | ||
454 | num, | ||
455 | GNUNET_NO, | ||
456 | write_message), | ||
457 | GNUNET_TESTING_cmd_stop_peer ("stop-peer", | ||
458 | "start-peer"), | ||
459 | GNUNET_TESTING_cmd_system_destroy ("system-destroy", | ||
460 | "system-create"), | ||
461 | GNUNET_TESTING_cmd_end () | ||
462 | }; | ||
463 | |||
464 | ts->write_message = write_message; | ||
465 | |||
466 | is = GNUNET_TESTING_run (commands, | ||
467 | TIMEOUT, | ||
468 | &handle_result, | ||
469 | ts); | ||
470 | return is; | ||
471 | } | ||
472 | |||
473 | |||
474 | /** | ||
475 | * Entry point for the plugin. | ||
476 | * | ||
477 | * @param cls NULL | ||
478 | * @return the exported block API | ||
479 | */ | ||
480 | void * | ||
481 | libgnunet_test_core_plugin_cmd_just_run_init (void *cls) | ||
482 | { | ||
483 | struct GNUNET_TESTING_PluginFunctions *api; | ||
484 | |||
485 | GNUNET_log_setup ("simple-send", | ||
486 | "DEBUG", | ||
487 | NULL); | ||
488 | |||
489 | api = GNUNET_new (struct GNUNET_TESTING_PluginFunctions); | ||
490 | api->start_testcase = &start_testcase; | ||
491 | api->get_waiting_for_barriers = get_waiting_for_barriers; | ||
492 | return api; | ||
493 | } | ||
494 | |||
495 | |||
496 | /** | ||
497 | * Exit point from the plugin. | ||
498 | * | ||
499 | * @param cls the return value from #libgnunet_test_transport_plugin_just_run_init | ||
500 | * @return NULL | ||
501 | */ | ||
502 | void * | ||
503 | libgnunet_test_core_plugin_cmd_just_run_done (void *cls) | ||
504 | { | ||
505 | struct GNUNET_TESTING_PluginFunctions *api = cls; | ||
506 | |||
507 | GNUNET_free (api); | ||
508 | return NULL; | ||
509 | } | ||
510 | |||
511 | |||
512 | /* end of plugin_cmd_simple_send.c */ | ||
diff --git a/src/core/test_core_start_testcase.sh b/src/core/test_core_start_testcase.sh new file mode 100755 index 000000000..78e67dbf5 --- /dev/null +++ b/src/core/test_core_start_testcase.sh | |||
@@ -0,0 +1,15 @@ | |||
1 | #!/bin/bash | ||
2 | echo gaga1 > gaga.txt | ||
3 | read -p "Test case configuration to use:" conf | ||
4 | if ! [ -d "/run/netns" ]; then | ||
5 | echo You have to create the directory /run/netns. | ||
6 | fi | ||
7 | if [ -f /proc/sys/kernel/unprivileged_userns_clone ]; then | ||
8 | if [ "$(cat /proc/sys/kernel/unprivileged_userns_clone)" != 1 ]; then | ||
9 | echo -e "Error during test setup: The kernel parameter kernel.unprivileged_userns_clone has to be set to 1! One has to execute\n\n sysctl kernel.unprivileged_userns_clone=1\n" | ||
10 | exit 78 | ||
11 | fi | ||
12 | fi | ||
13 | echo gaga2 >> gaga.txt | ||
14 | exec unshare -r -nmU bash -c "mount -t tmpfs --make-rshared tmpfs /run/netns; /usr/local/lib/gnunet/libexec/test_testing_start_with_config $conf" | ||
15 | echo gaga3 >> gaga.txt | ||
diff --git a/src/include/gnunet_testing_ng_lib.h b/src/include/gnunet_testing_ng_lib.h index 98ba65b59..eff45498b 100644 --- a/src/include/gnunet_testing_ng_lib.h +++ b/src/include/gnunet_testing_ng_lib.h | |||
@@ -621,6 +621,95 @@ typedef void * | |||
621 | (*GNUNET_TESTING_notify_connect_cb) (struct GNUNET_TESTING_Interpreter *is, | 621 | (*GNUNET_TESTING_notify_connect_cb) (struct GNUNET_TESTING_Interpreter *is, |
622 | const struct GNUNET_PeerIdentity *peer); | 622 | const struct GNUNET_PeerIdentity *peer); |
623 | 623 | ||
624 | /** | ||
625 | * Struct to store information needed in callbacks. | ||
626 | * | ||
627 | */ | ||
628 | struct GNUNET_TESTING_ConnectPeersState | ||
629 | { | ||
630 | /** | ||
631 | * Receive callback | ||
632 | */ | ||
633 | struct GNUNET_MQ_MessageHandler *handlers; | ||
634 | |||
635 | /** | ||
636 | * A map with struct GNUNET_MQ_Handle values for each peer this peer | ||
637 | * is connected to. | ||
638 | */ | ||
639 | struct GNUNET_CONTAINER_MultiShortmap *connected_peers_map; | ||
640 | |||
641 | /** | ||
642 | * Handle for transport. | ||
643 | */ | ||
644 | struct GNUNET_TRANSPORT_ApplicationHandle *ah; | ||
645 | |||
646 | /** | ||
647 | * Core handle. | ||
648 | */ | ||
649 | struct GNUNET_TRANSPORT_CoreHandle *th; | ||
650 | |||
651 | /** | ||
652 | * Context for our asynchronous completion. | ||
653 | */ | ||
654 | struct GNUNET_TESTING_AsyncContext ac; | ||
655 | |||
656 | /** | ||
657 | * The testing system of this node. | ||
658 | */ | ||
659 | const struct GNUNET_TESTING_System *tl_system; | ||
660 | |||
661 | // Label of the cmd which started the test system. | ||
662 | const char *create_label; | ||
663 | |||
664 | /** | ||
665 | * Number globally identifying the node. | ||
666 | * | ||
667 | */ | ||
668 | uint32_t num; | ||
669 | |||
670 | /** | ||
671 | * Label of the cmd to start a peer. | ||
672 | * | ||
673 | */ | ||
674 | const char *start_peer_label; | ||
675 | |||
676 | /** | ||
677 | * The topology of the test setup. | ||
678 | */ | ||
679 | struct GNUNET_TESTING_NetjailTopology *topology; | ||
680 | |||
681 | /** | ||
682 | * Connections to other peers. | ||
683 | */ | ||
684 | struct GNUNET_TESTING_NodeConnection *node_connections_head; | ||
685 | |||
686 | struct GNUNET_TESTING_Interpreter *is; | ||
687 | |||
688 | /** | ||
689 | * Number of connections. | ||
690 | */ | ||
691 | unsigned int con_num; | ||
692 | |||
693 | /** | ||
694 | * Number of additional connects this cmd will wait for not triggered by this cmd. | ||
695 | */ | ||
696 | unsigned int additional_connects; | ||
697 | |||
698 | /** | ||
699 | * Number of connections we already have a notification for. | ||
700 | */ | ||
701 | unsigned int con_num_notified; | ||
702 | |||
703 | /** | ||
704 | * Number of additional connects this cmd will wait for not triggered by this cmd we already have a notification for. | ||
705 | */ | ||
706 | unsigned int additional_connects_notified; | ||
707 | |||
708 | /** | ||
709 | * Flag indicating, whether the command is waiting for peers to connect that are configured to connect. | ||
710 | */ | ||
711 | unsigned int wait_for_connect; | ||
712 | }; | ||
624 | 713 | ||
625 | /** | 714 | /** |
626 | * Struct to store information needed in callbacks. | 715 | * Struct to store information needed in callbacks. |
@@ -899,7 +988,7 @@ struct GNUNET_TESTING_StartPeerState | |||
899 | op (hello_size, const size_t) \ | 988 | op (hello_size, const size_t) \ |
900 | op (hello, const char) \ | 989 | op (hello, const char) \ |
901 | op (application_handle, const struct GNUNET_TRANSPORT_ApplicationHandle) \ | 990 | op (application_handle, const struct GNUNET_TRANSPORT_ApplicationHandle) \ |
902 | op (connect_peer_state, const struct ConnectPeersState) \ | 991 | op (connect_peer_state, const struct GNUNET_TESTING_ConnectPeersState) \ |
903 | op (state, const struct GNUNET_TESTING_StartPeerState) \ | 992 | op (state, const struct GNUNET_TESTING_StartPeerState) \ |
904 | op (broadcast, const enum GNUNET_GenericReturnValue) | 993 | op (broadcast, const enum GNUNET_GenericReturnValue) |
905 | 994 | ||
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 93d6aed13..5b51f3edd 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am | |||
@@ -363,25 +363,7 @@ plugin_LTLIBRARIES = \ | |||
363 | libgnunet_test_transport_plugin_cmd_simple_send.la \ | 363 | libgnunet_test_transport_plugin_cmd_simple_send.la \ |
364 | libgnunet_test_transport_plugin_cmd_simple_send_broadcast.la \ | 364 | libgnunet_test_transport_plugin_cmd_simple_send_broadcast.la \ |
365 | libgnunet_test_transport_plugin_cmd_simple_send_dv.la \ | 365 | libgnunet_test_transport_plugin_cmd_simple_send_dv.la \ |
366 | libgnunet_test_transport_plugin_cmd_udp_backchannel.la \ | 366 | libgnunet_test_transport_plugin_cmd_udp_backchannel.la |
367 | libgnunet_test_transport_plugin_cmd_just_run.la | ||
368 | |||
369 | libgnunet_test_transport_plugin_cmd_just_run_la_SOURCES = \ | ||
370 | test_transport_plugin_cmd_just_run.c | ||
371 | libgnunet_test_transport_plugin_cmd_just_run_la_LIBADD = \ | ||
372 | libgnunettransporttesting2.la \ | ||
373 | libgnunettransportapplication.la \ | ||
374 | libgnunettransportcore.la \ | ||
375 | $(top_builddir)/src/testing/libgnunettesting.la \ | ||
376 | $(top_builddir)/src/peerstore/libgnunetpeerstore.la \ | ||
377 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | ||
378 | $(top_builddir)/src/hello/libgnunethello.la \ | ||
379 | $(top_builddir)/src/ats/libgnunetats.la \ | ||
380 | $(top_builddir)/src/arm/libgnunetarm.la \ | ||
381 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
382 | $(LTLIBINTL) | ||
383 | libgnunet_test_transport_plugin_cmd_just_run_la_LDFLAGS = \ | ||
384 | $(GN_PLUGIN_LDFLAGS) | ||
385 | 367 | ||
386 | libgnunet_test_transport_plugin_cmd_nat_upnp_la_SOURCES = \ | 368 | libgnunet_test_transport_plugin_cmd_nat_upnp_la_SOURCES = \ |
387 | test_transport_plugin_cmd_nat_upnp.c | 369 | test_transport_plugin_cmd_nat_upnp.c |
diff --git a/src/transport/test_transport_api2_tng_node.conf b/src/transport/test_transport_api2_tng_node.conf index 61ffbe92f..b2514b39f 100644 --- a/src/transport/test_transport_api2_tng_node.conf +++ b/src/transport/test_transport_api2_tng_node.conf | |||
@@ -29,3 +29,12 @@ UNIXPATH = $GNUNET_RUNTIME_DIR/udp-comm-p1.sock | |||
29 | 29 | ||
30 | [peerstore] | 30 | [peerstore] |
31 | IMMEDIATE_START = YES | 31 | IMMEDIATE_START = YES |
32 | |||
33 | [topology] | ||
34 | IMMEDIATE_START = YES | ||
35 | |||
36 | [dht] | ||
37 | IMMEDIATE_START = YES | ||
38 | |||
39 | [fs] | ||
40 | IMMEDIATE_START = YES | ||
diff --git a/src/transport/test_transport_start_with_config.c b/src/transport/test_transport_start_with_config.c index 8a7a3dbb5..a2c692dbc 100644 --- a/src/transport/test_transport_start_with_config.c +++ b/src/transport/test_transport_start_with_config.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_testing_ng_lib.h" | 27 | #include "gnunet_testing_ng_lib.h" |
28 | #include "gnunet_testing_netjail_lib.h" | 28 | #include "gnunet_testing_netjail_lib.h" |
29 | #include "transport-testing-cmds.h" | ||
30 | #include "gnunet_util_lib.h" | 29 | #include "gnunet_util_lib.h" |
31 | 30 | ||
32 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) | 31 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) |