aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport_api_cmd_start_peer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/transport_api_cmd_start_peer.c')
-rw-r--r--src/transport/transport_api_cmd_start_peer.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/transport/transport_api_cmd_start_peer.c b/src/transport/transport_api_cmd_start_peer.c
index 729d981c0..f4e92944b 100644
--- a/src/transport/transport_api_cmd_start_peer.c
+++ b/src/transport/transport_api_cmd_start_peer.c
@@ -29,7 +29,7 @@
29#include "gnunet_peerstore_service.h" 29#include "gnunet_peerstore_service.h"
30#include "gnunet_transport_core_service.h" 30#include "gnunet_transport_core_service.h"
31#include "gnunet_transport_application_service.h" 31#include "gnunet_transport_application_service.h"
32#include "transport-testing-ng.h" 32#include "transport-testing-cmds.h"
33 33
34/** 34/**
35 * Generic logging shortcut 35 * Generic logging shortcut
@@ -185,6 +185,10 @@ start_peer_run (void *cls,
185 struct GNUNET_PeerIdentity dummy; 185 struct GNUNET_PeerIdentity dummy;
186 const struct GNUNET_TESTING_Command *system_cmd; 186 const struct GNUNET_TESTING_Command *system_cmd;
187 struct GNUNET_TESTING_System *tl_system; 187 struct GNUNET_TESTING_System *tl_system;
188 char *home;
189 char *transport_unix_path;
190 char *communicator_unix_path;
191 char *bindto;
188 192
189 if (GNUNET_NO == GNUNET_DISK_file_test (sps->cfgname)) 193 if (GNUNET_NO == GNUNET_DISK_file_test (sps->cfgname))
190 { 194 {
@@ -200,6 +204,34 @@ start_peer_run (void *cls,
200 GNUNET_assert (GNUNET_OK == 204 GNUNET_assert (GNUNET_OK ==
201 GNUNET_CONFIGURATION_load (sps->cfg, sps->cfgname)); 205 GNUNET_CONFIGURATION_load (sps->cfg, sps->cfgname));
202 206
207 GNUNET_asprintf (&home,
208 "$GNUNET_TMP/test-transport/api-tcp-p%u",
209 sps->no);
210
211 GNUNET_asprintf (&transport_unix_path,
212 "$GNUNET_RUNTIME_DIR/tng-p%u.sock",
213 sps->no);
214
215 GNUNET_asprintf (&communicator_unix_path,
216 "$GNUNET_RUNTIME_DIR/tcp-comm-p%u.sock",
217 sps->no);
218
219 GNUNET_asprintf (&bindto,
220 "%s:60002",
221 sps->node_ip);
222
223
224 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "PATHS", "GNUNET_TEST_HOME",
225 home);
226 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "transport", "UNIXPATH",
227 transport_unix_path);
228 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "communicator-tcp",
229 "BINDTO",
230 bindto);
231 GNUNET_CONFIGURATION_set_value_string (sps->cfg, "communicator-tcp",
232 "UNIXPATH",
233 communicator_unix_path);
234
203 system_cmd = GNUNET_TESTING_interpreter_lookup_command (sps->system_label); 235 system_cmd = GNUNET_TESTING_interpreter_lookup_command (sps->system_label);
204 GNUNET_TESTING_get_trait_test_system (system_cmd, 236 GNUNET_TESTING_get_trait_test_system (system_cmd,
205 &tl_system); 237 &tl_system);
@@ -536,6 +568,7 @@ GNUNET_TRANSPORT_cmd_start_peer (const char *label,
536 char *m, 568 char *m,
537 char *n, 569 char *n,
538 char *local_m, 570 char *local_m,
571 char *node_ip,
539 struct GNUNET_MQ_MessageHandler *handlers, 572 struct GNUNET_MQ_MessageHandler *handlers,
540 const char *cfgname) 573 const char *cfgname)
541{ 574{
@@ -552,6 +585,7 @@ GNUNET_TRANSPORT_cmd_start_peer (const char *label,
552 sps->system_label = system_label; 585 sps->system_label = system_label;
553 sps->connected_peers_map = connected_peers_map; 586 sps->connected_peers_map = connected_peers_map;
554 sps->cfgname = cfgname; 587 sps->cfgname = cfgname;
588 sps->node_ip = node_ip;
555 589
556 if (NULL != handlers) 590 if (NULL != handlers)
557 { 591 {