summaryrefslogtreecommitdiff
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 @@
#include "gnunet_peerstore_service.h"
#include "gnunet_transport_core_service.h"
#include "gnunet_transport_application_service.h"
-#include "transport-testing-ng.h"
+#include "transport-testing-cmds.h"
/**
* Generic logging shortcut
@@ -185,6 +185,10 @@ start_peer_run (void *cls,
struct GNUNET_PeerIdentity dummy;
const struct GNUNET_TESTING_Command *system_cmd;
struct GNUNET_TESTING_System *tl_system;
+ char *home;
+ char *transport_unix_path;
+ char *communicator_unix_path;
+ char *bindto;
if (GNUNET_NO == GNUNET_DISK_file_test (sps->cfgname))
{
@@ -200,6 +204,34 @@ start_peer_run (void *cls,
GNUNET_assert (GNUNET_OK ==
GNUNET_CONFIGURATION_load (sps->cfg, sps->cfgname));
+ GNUNET_asprintf (&home,
+ "$GNUNET_TMP/test-transport/api-tcp-p%u",
+ sps->no);
+
+ GNUNET_asprintf (&transport_unix_path,
+ "$GNUNET_RUNTIME_DIR/tng-p%u.sock",
+ sps->no);
+
+ GNUNET_asprintf (&communicator_unix_path,
+ "$GNUNET_RUNTIME_DIR/tcp-comm-p%u.sock",
+ sps->no);
+
+ GNUNET_asprintf (&bindto,
+ "%s:60002",
+ sps->node_ip);
+
+
+ GNUNET_CONFIGURATION_set_value_string (sps->cfg, "PATHS", "GNUNET_TEST_HOME",
+ home);
+ GNUNET_CONFIGURATION_set_value_string (sps->cfg, "transport", "UNIXPATH",
+ transport_unix_path);
+ GNUNET_CONFIGURATION_set_value_string (sps->cfg, "communicator-tcp",
+ "BINDTO",
+ bindto);
+ GNUNET_CONFIGURATION_set_value_string (sps->cfg, "communicator-tcp",
+ "UNIXPATH",
+ communicator_unix_path);
+
system_cmd = GNUNET_TESTING_interpreter_lookup_command (sps->system_label);
GNUNET_TESTING_get_trait_test_system (system_cmd,
&tl_system);
@@ -536,6 +568,7 @@ GNUNET_TRANSPORT_cmd_start_peer (const char *label,
char *m,
char *n,
char *local_m,
+ char *node_ip,
struct GNUNET_MQ_MessageHandler *handlers,
const char *cfgname)
{
@@ -552,6 +585,7 @@ GNUNET_TRANSPORT_cmd_start_peer (const char *label,
sps->system_label = system_label;
sps->connected_peers_map = connected_peers_map;
sps->cfgname = cfgname;
+ sps->node_ip = node_ip;
if (NULL != handlers)
{