aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2021-07-28 15:52:48 +0200
committert3sserakt <t3ss@posteo.de>2021-07-28 15:52:48 +0200
commit1a542d67de29d6ed40706ca70988f79bfd00fb38 (patch)
tree59e314aba37ca93411c32c5c6909192c85cfc4f7
parentf550f04aa52852ca0d04552a5e103f51ff1023e6 (diff)
downloadgnunet-1a542d67de29d6ed40706ca70988f79bfd00fb38.tar.gz
gnunet-1a542d67de29d6ed40706ca70988f79bfd00fb38.zip
- simple test without sending. peers setup working.
-rw-r--r--po/POTFILES.in3
-rw-r--r--src/testbed/Makefile.am2
-rw-r--r--src/testbed/gnunet-cmds-helper.c2
-rw-r--r--src/testbed/testbed_api.h2
-rw-r--r--src/testbed/testbed_api_cmd_local_test_finished.c2
-rw-r--r--src/testbed/testbed_api_cmd_netjail_start_testbed.c13
-rw-r--r--src/transport/Makefile.am24
-rw-r--r--src/transport/transport_api_cmd_connecting_peers.c3
-rw-r--r--src/transport/transport_api_cmd_start_peer.c51
9 files changed, 76 insertions, 26 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 042a4b1df..b02a3fea4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -206,6 +206,7 @@ src/json/json.c
206src/json/json_generator.c 206src/json/json_generator.c
207src/json/json_helper.c 207src/json/json_helper.c
208src/json/json_mhd.c 208src/json/json_mhd.c
209src/json/json_pack.c
209src/messenger/gnunet-messenger.c 210src/messenger/gnunet-messenger.c
210src/messenger/gnunet-service-messenger.c 211src/messenger/gnunet-service-messenger.c
211src/messenger/gnunet-service-messenger_basement.c 212src/messenger/gnunet-service-messenger_basement.c
@@ -294,6 +295,7 @@ src/peerstore/plugin_peerstore_sqlite.c
294src/pq/pq.c 295src/pq/pq.c
295src/pq/pq_connect.c 296src/pq/pq_connect.c
296src/pq/pq_eval.c 297src/pq/pq_eval.c
298src/pq/pq_event.c
297src/pq/pq_exec.c 299src/pq/pq_exec.c
298src/pq/pq_prepare.c 300src/pq/pq_prepare.c
299src/pq/pq_query_helper.c 301src/pq/pq_query_helper.c
@@ -595,5 +597,6 @@ src/vpn/vpn_api.c
595src/zonemaster/gnunet-service-zonemaster-monitor.c 597src/zonemaster/gnunet-service-zonemaster-monitor.c
596src/zonemaster/gnunet-service-zonemaster.c 598src/zonemaster/gnunet-service-zonemaster.c
597src/fs/fs_api.h 599src/fs/fs_api.h
600src/include/gnunet_json_lib.h
598src/testbed/testbed_api.h 601src/testbed/testbed_api.h
599src/testbed/testbed_api_operations.h 602src/testbed/testbed_api_operations.h
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am
index c1d89607c..347d16007 100644
--- a/src/testbed/Makefile.am
+++ b/src/testbed/Makefile.am
@@ -102,6 +102,8 @@ gnunet_cmds_helper_SOURCES = \
102gnunet_cmds_helper_LDADD = $(XLIB) \ 102gnunet_cmds_helper_LDADD = $(XLIB) \
103 $(top_builddir)/src/util/libgnunetutil.la \ 103 $(top_builddir)/src/util/libgnunetutil.la \
104 $(top_builddir)/src/testing/libgnunettesting.la \ 104 $(top_builddir)/src/testing/libgnunettesting.la \
105 $(top_builddir)/src/transport/libgnunettransporttesting2.la \
106 libgnunettestbed.la \
105 $(LTLIBINTL) $(Z_LIBS) 107 $(LTLIBINTL) $(Z_LIBS)
106 108
107gnunet_daemon_testbed_blacklist_SOURCES = gnunet-daemon-testbed-blacklist.c 109gnunet_daemon_testbed_blacklist_SOURCES = gnunet-daemon-testbed-blacklist.c
diff --git a/src/testbed/gnunet-cmds-helper.c b/src/testbed/gnunet-cmds-helper.c
index 113e3c386..c4a3e98d9 100644
--- a/src/testbed/gnunet-cmds-helper.c
+++ b/src/testbed/gnunet-cmds-helper.c
@@ -411,7 +411,7 @@ tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message)
411 plugin = GNUNET_new (struct Plugin); 411 plugin = GNUNET_new (struct Plugin);
412 plugin->api = GNUNET_PLUGIN_load (plugin_name, 412 plugin->api = GNUNET_PLUGIN_load (plugin_name,
413 NULL); 413 NULL);
414 plugin->library_name = GNUNET_strdup (plugin_name); 414 plugin->library_name = GNUNET_strdup (basename(plugin_name));
415 415
416 plugin->global_n = ni->global_n; 416 plugin->global_n = ni->global_n;
417 plugin->local_m = ni->local_m; 417 plugin->local_m = ni->local_m;
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h
index 9a54ca36c..67aa6dc1c 100644
--- a/src/testbed/testbed_api.h
+++ b/src/testbed/testbed_api.h
@@ -40,7 +40,7 @@
40/** 40/**
41 * Cmds Helper binary name 41 * Cmds Helper binary name
42 */ 42 */
43#define HELPER_CMDS_BINARY "gnunet-cmds-helper" 43#define HELPER_CMDS_BINARY "./../testbed/gnunet-cmds-helper"
44 44
45 45
46/** 46/**
diff --git a/src/testbed/testbed_api_cmd_local_test_finished.c b/src/testbed/testbed_api_cmd_local_test_finished.c
index 8829f1b9a..b5f4b8b31 100644
--- a/src/testbed/testbed_api_cmd_local_test_finished.c
+++ b/src/testbed/testbed_api_cmd_local_test_finished.c
@@ -93,6 +93,8 @@ local_test_finished_finish (void *cls,
93 void *cont_cls) 93 void *cont_cls)
94{ 94{
95 // This will stop the local loop without shutting down the scheduler, because we do not call the continuation, which is the interpreter_next method. 95 // This will stop the local loop without shutting down the scheduler, because we do not call the continuation, which is the interpreter_next method.
96 LOG (GNUNET_ERROR_TYPE_ERROR,
97 "Stopping local loop\n");
96 return GNUNET_YES; 98 return GNUNET_YES;
97} 99}
98 100
diff --git a/src/testbed/testbed_api_cmd_netjail_start_testbed.c b/src/testbed/testbed_api_cmd_netjail_start_testbed.c
index 67f0ef55c..de3926696 100644
--- a/src/testbed/testbed_api_cmd_netjail_start_testbed.c
+++ b/src/testbed/testbed_api_cmd_netjail_start_testbed.c
@@ -328,8 +328,7 @@ start_testbed (struct NetJailState *ns, struct
328 char *const script_argv[] = {NETJAIL_EXEC_SCRIPT, 328 char *const script_argv[] = {NETJAIL_EXEC_SCRIPT,
329 m_char, 329 m_char,
330 n_char, 330 n_char,
331 GNUNET_OS_get_libexec_binary_path ( 331 HELPER_CMDS_BINARY,
332 HELPER_CMDS_BINARY),
333 ns->global_n, 332 ns->global_n,
334 ns->local_m, 333 ns->local_m,
335 NULL}; 334 NULL};
@@ -373,6 +372,9 @@ start_testbed (struct NetJailState *ns, struct
373 &exp_cb, 372 &exp_cb,
374 tbc)); 373 tbc));
375 374
375 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
376 "First using helper %d\n",
377 tbc->count - 1);
376 struct GNUNET_HELPER_Handle *helper = ns->helper[tbc->count - 1]; 378 struct GNUNET_HELPER_Handle *helper = ns->helper[tbc->count - 1];
377 379
378 msg = create_helper_init_msg_ (m_char, 380 msg = create_helper_init_msg_ (m_char,
@@ -469,7 +471,12 @@ netjail_start_finish (void *cls,
469 tbc = GNUNET_new (struct TestbedCount); 471 tbc = GNUNET_new (struct TestbedCount);
470 tbc->ns = ns; 472 tbc->ns = ns;
471 // TODO This needs to be more generic. As we send more messages back and forth, we can not grow the arrays again and again, because this is to error prone. 473 // TODO This needs to be more generic. As we send more messages back and forth, we can not grow the arrays again and again, because this is to error prone.
472 tbc->count = (j - 1) * atoi (ns->local_m) + i + total_number; 474 tbc->count = (i - 1) * atoi (ns->local_m) + j + total_number;
475 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
476 "Second using helper %d %d %d\n",
477 tbc->count - 1 - total_number,
478 i,
479 j);
473 helper = ns->helper[tbc->count - 1 - total_number]; 480 helper = ns->helper[tbc->count - 1 - total_number];
474 msg_length = sizeof(struct GNUNET_CMDS_ALL_PEERS_STARTED); 481 msg_length = sizeof(struct GNUNET_CMDS_ALL_PEERS_STARTED);
475 reply = GNUNET_new (struct GNUNET_CMDS_ALL_PEERS_STARTED); 482 reply = GNUNET_new (struct GNUNET_CMDS_ALL_PEERS_STARTED);
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am
index 3d8fa7774..2d3615e6a 100644
--- a/src/transport/Makefile.am
+++ b/src/transport/Makefile.am
@@ -397,18 +397,18 @@ 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# libgnunettransporttesting2.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
diff --git a/src/transport/transport_api_cmd_connecting_peers.c b/src/transport/transport_api_cmd_connecting_peers.c
index 0f2154c46..d9253b6d4 100644
--- a/src/transport/transport_api_cmd_connecting_peers.c
+++ b/src/transport/transport_api_cmd_connecting_peers.c
@@ -124,6 +124,9 @@ connect_peers_finish (void *cls,
124 } 124 }
125 125
126 return ret;*/ 126 return ret;*/
127 cont (cont_cls);
128 LOG (GNUNET_ERROR_TYPE_ERROR,
129 "connect peer finish\n");
127 return GNUNET_OK; 130 return GNUNET_OK;
128} 131}
129 132
diff --git a/src/transport/transport_api_cmd_start_peer.c b/src/transport/transport_api_cmd_start_peer.c
index c9af497ae..c2cc20a2a 100644
--- a/src/transport/transport_api_cmd_start_peer.c
+++ b/src/transport/transport_api_cmd_start_peer.c
@@ -54,7 +54,7 @@ struct StartPeerState
54 /** 54 /**
55 * Peer identity 55 * Peer identity
56 */ 56 */
57 struct GNUNET_PeerIdentity *id; 57 struct GNUNET_PeerIdentity id;
58 58
59 /** 59 /**
60 * Peer's transport service handle 60 * Peer's transport service handle
@@ -145,7 +145,7 @@ retrieve_hello (void *cls)
145 sps->rh_task = NULL; 145 sps->rh_task = NULL;
146 sps->pic = GNUNET_PEERSTORE_iterate (sps->ph, 146 sps->pic = GNUNET_PEERSTORE_iterate (sps->ph,
147 "transport", 147 "transport",
148 sps->id, 148 &sps->id,
149 GNUNET_PEERSTORE_TRANSPORT_HELLO_KEY, 149 GNUNET_PEERSTORE_TRANSPORT_HELLO_KEY,
150 hello_iter_cb, 150 hello_iter_cb,
151 sps); 151 sps);
@@ -179,7 +179,7 @@ notify_disconnect (void *cls,
179 "Peer %s disconnected from peer %u (`%s')\n", 179 "Peer %s disconnected from peer %u (`%s')\n",
180 GNUNET_i2s (peer), 180 GNUNET_i2s (peer),
181 sps->no, 181 sps->no,
182 GNUNET_i2s (sps->id)); 182 GNUNET_i2s (&sps->id));
183 183
184} 184}
185 185
@@ -199,7 +199,7 @@ notify_connect (void *cls,
199 "Peer %s connected to peer %u (`%s')\n", 199 "Peer %s connected to peer %u (`%s')\n",
200 GNUNET_i2s (peer), 200 GNUNET_i2s (peer),
201 sps->no, 201 sps->no,
202 GNUNET_i2s (sps->id)); 202 GNUNET_i2s (&sps->id));
203 203
204 GNUNET_CONTAINER_multipeermap_put (sps->connected_peers_map, 204 GNUNET_CONTAINER_multipeermap_put (sps->connected_peers_map,
205 peer, 205 peer,
@@ -222,6 +222,9 @@ start_peer_run (void *cls,
222 const struct GNUNET_TESTING_Command *system_cmd; 222 const struct GNUNET_TESTING_Command *system_cmd;
223 struct GNUNET_TESTING_System *tl_system; 223 struct GNUNET_TESTING_System *tl_system;
224 224
225 LOG (GNUNET_ERROR_TYPE_ERROR,
226 "start peer 1\n");
227
225 if (GNUNET_NO == GNUNET_DISK_file_test (sps->cfgname)) 228 if (GNUNET_NO == GNUNET_DISK_file_test (sps->cfgname))
226 { 229 {
227 LOG (GNUNET_ERROR_TYPE_ERROR, 230 LOG (GNUNET_ERROR_TYPE_ERROR,
@@ -251,8 +254,11 @@ start_peer_run (void *cls,
251 sps->cfgname); 254 sps->cfgname);
252 GNUNET_CONFIGURATION_destroy (sps->cfg); 255 GNUNET_CONFIGURATION_destroy (sps->cfg);
253 GNUNET_TESTING_interpreter_fail (); 256 GNUNET_TESTING_interpreter_fail ();
257 return;
254 } 258 }
255 259
260 LOG (GNUNET_ERROR_TYPE_ERROR,
261 "start peer 2\n");
256 sps->peer = GNUNET_TESTING_peer_configure (sps->tl_system, 262 sps->peer = GNUNET_TESTING_peer_configure (sps->tl_system,
257 sps->cfg, 263 sps->cfg,
258 sps->no, 264 sps->no,
@@ -266,8 +272,11 @@ start_peer_run (void *cls,
266 emsg); 272 emsg);
267 GNUNET_free (emsg); 273 GNUNET_free (emsg);
268 GNUNET_TESTING_interpreter_fail (); 274 GNUNET_TESTING_interpreter_fail ();
275 return;
269 } 276 }
270 277
278 LOG (GNUNET_ERROR_TYPE_ERROR,
279 "start peer 3\n");
271 if (GNUNET_OK != GNUNET_TESTING_peer_start (sps->peer)) 280 if (GNUNET_OK != GNUNET_TESTING_peer_start (sps->peer))
272 { 281 {
273 LOG (GNUNET_ERROR_TYPE_ERROR, 282 LOG (GNUNET_ERROR_TYPE_ERROR,
@@ -275,13 +284,19 @@ start_peer_run (void *cls,
275 sps->cfgname); 284 sps->cfgname);
276 GNUNET_free (emsg); 285 GNUNET_free (emsg);
277 GNUNET_TESTING_interpreter_fail (); 286 GNUNET_TESTING_interpreter_fail ();
287 return;
278 } 288 }
279 289LOG (GNUNET_ERROR_TYPE_ERROR,
290 "start peer 4\n");
280 memset (&dummy, 291 memset (&dummy,
281 '\0', 292 '\0',
282 sizeof(dummy)); 293 sizeof(dummy));
294 LOG (GNUNET_ERROR_TYPE_ERROR,
295 "start peer 4.1\n");
283 GNUNET_TESTING_peer_get_identity (sps->peer, 296 GNUNET_TESTING_peer_get_identity (sps->peer,
284 sps->id); 297 &sps->id);
298 LOG (GNUNET_ERROR_TYPE_ERROR,
299 "start peer 4.2\n");
285 if (0 == memcmp (&dummy, 300 if (0 == memcmp (&dummy,
286 &sps->id, 301 &sps->id,
287 sizeof(struct GNUNET_PeerIdentity))) 302 sizeof(struct GNUNET_PeerIdentity)))
@@ -291,11 +306,14 @@ start_peer_run (void *cls,
291 sps->no); 306 sps->no);
292 GNUNET_free (emsg); 307 GNUNET_free (emsg);
293 GNUNET_TESTING_interpreter_fail (); 308 GNUNET_TESTING_interpreter_fail ();
309 return;
294 } 310 }
295 LOG (GNUNET_ERROR_TYPE_DEBUG, 311 LOG (GNUNET_ERROR_TYPE_DEBUG,
296 "Peer %u configured with identity `%s'\n", 312 "Peer %u configured with identity `%s'\n",
297 sps->no, 313 sps->no,
298 GNUNET_i2s_full (sps->id)); 314 GNUNET_i2s_full (&sps->id));
315 LOG (GNUNET_ERROR_TYPE_ERROR,
316 "start peer 4.3\n");
299 sps->th = GNUNET_TRANSPORT_core_connect (sps->cfg, 317 sps->th = GNUNET_TRANSPORT_core_connect (sps->cfg,
300 NULL, 318 NULL,
301 sps->handlers, 319 sps->handlers,
@@ -310,7 +328,10 @@ start_peer_run (void *cls,
310 emsg); 328 emsg);
311 GNUNET_free (emsg); 329 GNUNET_free (emsg);
312 GNUNET_TESTING_interpreter_fail (); 330 GNUNET_TESTING_interpreter_fail ();
331 return;
313 } 332 }
333 LOG (GNUNET_ERROR_TYPE_ERROR,
334 "start peer 5\n");
314 sps->ph = GNUNET_PEERSTORE_connect (sps->cfg); 335 sps->ph = GNUNET_PEERSTORE_connect (sps->cfg);
315 if (NULL == sps->th) 336 if (NULL == sps->th)
316 { 337 {
@@ -320,7 +341,10 @@ start_peer_run (void *cls,
320 emsg); 341 emsg);
321 GNUNET_free (emsg); 342 GNUNET_free (emsg);
322 GNUNET_TESTING_interpreter_fail (); 343 GNUNET_TESTING_interpreter_fail ();
344 return;
323 } 345 }
346 LOG (GNUNET_ERROR_TYPE_ERROR,
347 "start peer 6\n");
324 sps->ah = GNUNET_TRANSPORT_application_init (sps->cfg); 348 sps->ah = GNUNET_TRANSPORT_application_init (sps->cfg);
325 if (NULL == sps->ah) 349 if (NULL == sps->ah)
326 { 350 {
@@ -330,6 +354,7 @@ start_peer_run (void *cls,
330 emsg); 354 emsg);
331 GNUNET_free (emsg); 355 GNUNET_free (emsg);
332 GNUNET_TESTING_interpreter_fail (); 356 GNUNET_TESTING_interpreter_fail ();
357 return;
333 } 358 }
334 sps->rh_task = GNUNET_SCHEDULER_add_now (retrieve_hello, sps); 359 sps->rh_task = GNUNET_SCHEDULER_add_now (retrieve_hello, sps);
335} 360}
@@ -374,7 +399,7 @@ start_peer_cleanup (void *cls,
374 LOG (GNUNET_ERROR_TYPE_DEBUG, 399 LOG (GNUNET_ERROR_TYPE_DEBUG,
375 "Testing lib failed to stop peer %u (`%s')\n", 400 "Testing lib failed to stop peer %u (`%s')\n",
376 sps->no, 401 sps->no,
377 GNUNET_i2s (sps->id)); 402 GNUNET_i2s (&sps->id));
378 } 403 }
379 GNUNET_TESTING_peer_destroy (sps->peer); 404 GNUNET_TESTING_peer_destroy (sps->peer);
380 sps->peer = NULL; 405 sps->peer = NULL;
@@ -402,7 +427,7 @@ start_peer_traits (void *cls,
402{ 427{
403 struct StartPeerState *sps = cls; 428 struct StartPeerState *sps = cls;
404 struct GNUNET_TRANSPORT_ApplicationHandle *ah = sps->ah; 429 struct GNUNET_TRANSPORT_ApplicationHandle *ah = sps->ah;
405 struct GNUNET_PeerIdentity *id = sps->id; 430 struct GNUNET_PeerIdentity *id = &sps->id;
406 struct GNUNET_CONTAINER_MultiPeerMap *connected_peers_map = 431 struct GNUNET_CONTAINER_MultiPeerMap *connected_peers_map =
407 sps->connected_peers_map; 432 sps->connected_peers_map;
408 char *hello = sps->hello; 433 char *hello = sps->hello;
@@ -528,6 +553,9 @@ GNUNET_TRANSPORT_cmd_start_peer (const char *label,
528 GNUNET_CONTAINER_multipeermap_create (1,GNUNET_NO); 553 GNUNET_CONTAINER_multipeermap_create (1,GNUNET_NO);
529 unsigned int i; 554 unsigned int i;
530 555
556 LOG (GNUNET_ERROR_TYPE_ERROR,
557 "start peer 0.1\n");
558
531 sps = GNUNET_new (struct StartPeerState); 559 sps = GNUNET_new (struct StartPeerState);
532 sps->m = m; 560 sps->m = m;
533 sps->n = n; 561 sps->n = n;
@@ -535,6 +563,9 @@ GNUNET_TRANSPORT_cmd_start_peer (const char *label,
535 sps->connected_peers_map = connected_peers_map; 563 sps->connected_peers_map = connected_peers_map;
536 sps->cfgname = cfgname; 564 sps->cfgname = cfgname;
537 565
566 LOG (GNUNET_ERROR_TYPE_ERROR,
567 "start peer 0.2\n");
568
538 if (NULL != handlers) 569 if (NULL != handlers)
539 { 570 {
540 for (i = 0; NULL != handlers[i].cb; i++) 571 for (i = 0; NULL != handlers[i].cb; i++)
@@ -546,6 +577,8 @@ GNUNET_TRANSPORT_cmd_start_peer (const char *label,
546 i * sizeof(struct GNUNET_MQ_MessageHandler)); 577 i * sizeof(struct GNUNET_MQ_MessageHandler));
547 } 578 }
548 579
580 LOG (GNUNET_ERROR_TYPE_ERROR,
581 "start peer 0.3\n");
549 struct GNUNET_TESTING_Command cmd = { 582 struct GNUNET_TESTING_Command cmd = {
550 .cls = sps, 583 .cls = sps,
551 .label = label, 584 .label = label,