aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/test_transport_plugin_cmd_simple_send_broadcast.c')
-rw-r--r--src/transport/test_transport_plugin_cmd_simple_send_broadcast.c56
1 files changed, 41 insertions, 15 deletions
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
index 986fe6014..e2757671b 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
@@ -74,7 +74,6 @@ static struct GNUNET_TESTING_Command connect_peers;
74 74
75static struct GNUNET_TESTING_Command local_prepared; 75static struct GNUNET_TESTING_Command local_prepared;
76 76
77
78/** 77/**
79 * Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being 78 * Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being
80 * received. 79 * received.
@@ -164,25 +163,50 @@ handle_result (void *cls,
164 * 163 *
165 */ 164 */
166static void * 165static void *
167notify_connect (void *cls, 166notify_connect (struct GNUNET_TESTING_Interpreter *is,
168 const struct GNUNET_PeerIdentity *peer, 167 const struct GNUNET_PeerIdentity *peer)
169 struct GNUNET_MQ_Handle *mq)
170{ 168{
171 struct GNUNET_TESTING_AsyncContext *ac; 169 struct GNUNET_TESTING_AsyncContext *ac;
170 void *ret = NULL;
171 const struct GNUNET_TESTING_Command *cmd;
172 struct BlockState *bs;
173
172 174
173 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 175 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
174 "notify_connect\n"); 176 "notify_connect\n");
175 177
176 GNUNET_TESTING_get_trait_async_context (&connect_peers, 178 GNUNET_TESTING_get_trait_async_context (&connect_peers,
177 &ac); 179 &ac);
178 void *ret = NULL;
179 180
180 GNUNET_assert (NULL != ac); 181 if (NULL != ac->is)
181 if (NULL == ac->cont) 182 {
182 GNUNET_TESTING_async_fail (ac); 183 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
184 "notify_connect running\n");
185 GNUNET_assert (NULL != ac);
186 if (NULL == ac->cont)
187 GNUNET_TESTING_async_fail (ac);
188 else
189 GNUNET_TESTING_async_finish (ac);
190 }
183 else 191 else
184 GNUNET_TESTING_async_finish (ac); 192 {
185 193 cmd = GNUNET_TESTING_interpreter_lookup_future_command (is,
194 "connect-peers");
195
196 LOG (GNUNET_ERROR_TYPE_DEBUG,
197 "block state %s\n",
198 cmd->label);
199 GNUNET_TESTING_get_trait_block_state (cmd,&bs);
200
201 LOG (GNUNET_ERROR_TYPE_DEBUG,
202 "block state %u\n",
203 bs->asynchronous_finish);
204 bs->asynchronous_finish = GNUNET_YES;
205 LOG (GNUNET_ERROR_TYPE_DEBUG,
206 "block state %u\n",
207 bs->asynchronous_finish);
208 }
209
186 return ret; 210 return ret;
187} 211}
188 212
@@ -224,7 +248,6 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip,
224 char *topology_data, 248 char *topology_data,
225 unsigned int *read_file) 249 unsigned int *read_file)
226{ 250{
227
228 unsigned int n_int; 251 unsigned int n_int;
229 unsigned int m_int; 252 unsigned int m_int;
230 unsigned int local_m_int; 253 unsigned int local_m_int;
@@ -232,6 +255,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip,
232 struct TestState *ts = GNUNET_new (struct TestState); 255 struct TestState *ts = GNUNET_new (struct TestState);
233 struct GNUNET_TESTING_NetjailTopology *topology; 256 struct GNUNET_TESTING_NetjailTopology *topology;
234 257
258
259
235 if (GNUNET_YES == *read_file) 260 if (GNUNET_YES == *read_file)
236 { 261 {
237 LOG (GNUNET_ERROR_TYPE_DEBUG, 262 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -255,7 +280,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip,
255 block_send = GNUNET_TESTING_cmd_block_until_external_trigger ("block"); 280 block_send = GNUNET_TESTING_cmd_block_until_external_trigger ("block");
256 block_receive = GNUNET_TESTING_cmd_block_until_external_trigger ( 281 block_receive = GNUNET_TESTING_cmd_block_until_external_trigger (
257 "block-receive"); 282 "block-receive");
258 connect_peers = GNUNET_TESTING_cmd_block_until_external_trigger ("connect-peers"); 283 connect_peers = GNUNET_TESTING_cmd_block_until_external_trigger (
284 "connect-peers");
259 local_prepared = GNUNET_TESTING_cmd_local_test_prepared ( 285 local_prepared = GNUNET_TESTING_cmd_local_test_prepared (
260 "local-test-prepared", 286 "local-test-prepared",
261 write_message); 287 write_message);
@@ -264,11 +290,11 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip,
264 GNUNET_asprintf (&ts->cfgname, 290 GNUNET_asprintf (&ts->cfgname,
265 "test_transport_api2_tcp_node1.conf"); 291 "test_transport_api2_tcp_node1.conf");
266 292
267 LOG (GNUNET_ERROR_TYPE_ERROR, 293 LOG (GNUNET_ERROR_TYPE_DEBUG,
268 "plugin cfgname: %s\n", 294 "plugin cfgname: %s\n",
269 ts->cfgname); 295 ts->cfgname);
270 296
271 LOG (GNUNET_ERROR_TYPE_ERROR, 297 LOG (GNUNET_ERROR_TYPE_DEBUG,
272 "node ip: %s\n", 298 "node ip: %s\n",
273 node_ip); 299 node_ip);
274 300