#define TOPOLOGY_HACK GNUNET_YES
+/**
+ * How long do we wait after a FORK+EXEC before testing for the
+ * resulting process to be up (port open, waitpid, etc.)?
+ */
+#define GNUNET_CONSTANTS_EXEC_WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 200)
+
/**
* Lowest port used for GNUnet testing. Should be high enough to not
* conflict with other applications running on the hosts but be low
pg->peers[pg_iter].daemon->hostname,
temp_service_path);
procarr[pg_iter] =
- GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp", mytemp, arg, NULL);
+ GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "scp", "scp", mytemp, arg, NULL);
GNUNET_assert (procarr[pg_iter] != NULL);
ret = GNUNET_OS_process_wait (procarr[pg_iter]); /* FIXME: schedule this, throttle! */
GNUNET_OS_process_destroy (procarr[pg_iter]);
pg->peers[pg_iter].daemon->hostname,
temp_service_path);
procarr[pg_iter] =
- GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "scp", "scp", mytemp, arg, NULL);
+ GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "scp", "scp", mytemp, arg, NULL);
GNUNET_assert (procarr[pg_iter] != NULL);
GNUNET_OS_process_wait (procarr[pg_iter]); /* FIXME: add scheduled blacklist file copy that parallelizes file copying! */
for (i = 0; i < pg->total; i++)
{
- pg->peers[i].allowed_peers = GNUNET_CONTAINER_multihashmap_create (100);
- pg->peers[i].connect_peers = GNUNET_CONTAINER_multihashmap_create (100);
- pg->peers[i].blacklisted_peers = GNUNET_CONTAINER_multihashmap_create (100);
+ pg->peers[i].allowed_peers = GNUNET_CONTAINER_multihashmap_create (100, GNUNET_NO);
+ pg->peers[i].connect_peers = GNUNET_CONTAINER_multihashmap_create (100, GNUNET_NO);
+ pg->peers[i].blacklisted_peers = GNUNET_CONTAINER_multihashmap_create (100, GNUNET_NO);
pg->peers[i].pg = pg;
}
#endif
random_ctx.percentage = percentage;
random_ctx.pg = pg;
pg->peers[pg_iter].connect_peers_working_set =
- GNUNET_CONTAINER_multihashmap_create (pg->total);
+ GNUNET_CONTAINER_multihashmap_create (pg->total, GNUNET_NO);
GNUNET_CONTAINER_multihashmap_iterate (pg->peers[pg_iter].connect_peers,
&random_connect_iterator,
&random_ctx);
for (pg_iter = 0; pg_iter < pg->total; pg_iter++)
{
pg->peers[pg_iter].connect_peers_working_set =
- GNUNET_CONTAINER_multihashmap_create (num);
+ GNUNET_CONTAINER_multihashmap_create (num, GNUNET_NO);
}
for (pg_iter = 0; pg_iter < pg->total; pg_iter++)
for (pg_iter = 0; pg_iter < pg->total; pg_iter++)
{
pg->peers[pg_iter].connect_peers_working_set =
- GNUNET_CONTAINER_multihashmap_create (num);
+ GNUNET_CONTAINER_multihashmap_create (num, GNUNET_NO);
}
starting_peer = 0;
/* FIXME: Doesn't support ssh_port option! */
helper->proc =
- GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", arg,
+ GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "ssh", "ssh", arg,
"peerStartHelper.pl", tempdir, NULL);
GNUNET_assert (helper->proc != NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "starting peers with cmd ssh %s %s %s\n",
{
GNUNET_asprintf (&ssh_port_str, "%d", pg->hosts[i].sshport);
proc =
- GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", "-P", ssh_port_str,
+ GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "ssh", "ssh", "-P", ssh_port_str,
"-q",
arg, "mkdir -p", tmpdir, NULL);
}
else
proc =
- GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", arg, "mkdir -p",
+ GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "ssh", "ssh", arg, "mkdir -p",
tmpdir, NULL);
GNUNET_assert (proc != NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
GNUNET_CONFIGURATION_get_value_string (cfg, "TESTING_OLD", "HOSTKEYSFILE",
&hostkeys_file))
{
+ /* This is a hack to make old testing able to load keys from datadir,
+ * just as new testing does.
+ * No need to document it, just convert everything to the new testing
+ * framework...
+ */
+ char *DATADIR = "${DATADIR}";
+ size_t ddl = strlen (DATADIR);
+ if (strncmp (hostkeys_file, DATADIR, ddl) == 0)
+ {
+ char *data_dir;
+ char *filename;
+ data_dir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
+ GNUNET_asprintf (&filename, "%s%s", data_dir, &hostkeys_file[ddl]);
+ GNUNET_free (data_dir);
+ GNUNET_free (hostkeys_file);
+ hostkeys_file = filename;
+ }
if (GNUNET_YES != GNUNET_DISK_file_test (hostkeys_file))
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _("Could not read hostkeys file!\n"));
+ _("Could not read hostkeys file `%s'!\n"), hostkeys_file);
else
{
/* Check hostkey file size, read entire thing into memory */
/* FIXME: Doesn't support ssh_port option! */
proc =
- GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "rsync", "rsync", "-r",
+ GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "rsync", "rsync", "-r",
newservicehome, arg, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"copying directory with command rsync -r %s %s\n",