test_testing_topology_internat \
test_testing_topology_none \
test_testing_topology_scale_free \
- test_testing_new_portreservation
+ test_testing_new_portreservation \
+ test_testing_new_peerstartup
if ENABLE_TEST_RUN
TESTS = \
test_testing_reconnect \
test_testing_group \
test_testing_peergroup \
- test_testing_new_portreservation
+ test_testing_new_portreservation \
+ test_testing_new_peerstartup
endif
gnunet_testing_SOURCES = \
$(top_builddir)/src/testing/libgnunettesting_new.la \
$(top_builddir)/src/util/libgnunetutil.la
+test_testing_new_peerstartup_SOURCES = \
+ test_testing_new_peerstartup.c
+test_testing_new_peerstartup_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting_new.la \
+ $(top_builddir)/src/util/libgnunetutil.la
EXTRA_DIST = \
test_testing_defaults.conf \
#define LOG(kind,...) \
GNUNET_log_from (kind, "gnunettestingnew", __VA_ARGS__)
-#define TIME_REL_SEC(sec) \
- GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, sec)
-
/**
* Size of a hostkey when written to a file
if (NULL != system->hostkeys_data)
{
GNUNET_break (0); /* Use GNUNET_TESTING_hostkeys_unload() */
- GNUNET_free (system->hostkeys_data);
- system->hostkeys_data = NULL;
- system->total_hostkeys = 0;
+ GNUNET_TESTING_hostkeys_unload (system);
}
if (GNUNET_YES == remove_paths)
GNUNET_DISK_directory_remove (system->tmppath);
continue;
}
open_port = (index * 32) + pos;
- GNUNET_asprintf (&open_port_str, "%u", open_port);
+ GNUNET_asprintf (&open_port_str, "%u", (unsigned int) open_port);
ret = NULL;
GNUNET_assert (0 == getaddrinfo (NULL, open_port_str, &hint, &ret));
GNUNET_free (open_port_str);
socket = NULL;
port_buckets[index] |= (1U << pos); /* Set the port bit */
if (GNUNET_OK == bind_status)
+ {
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Found a free port %u\n", (unsigned int) open_port);
return open_port;
+ }
pos++;
}
}
if (GNUNET_OK != uc->status)
return;
+ if (! ((0 == strcmp (option, "PORT"))
+ || (0 == strcmp (option, "UNIXPATH"))
+ || (0 == strcmp (option, "HOSTNAME"))))
+ return;
GNUNET_asprintf (&single_variable, "single_%s_per_host", section);
GNUNET_asprintf (&per_host_variable, "num_%s_per_host", section);
if ((0 == strcmp (option, "PORT")) && (1 == SSCANF (value, "%u", &ival)))
GNUNET_CONFIGURATION_get_value_yesno (uc->cfg, "testing",
single_variable))
{
- GNUNET_snprintf (uval, sizeof (uval), "%s\\%s.sock",
+ GNUNET_snprintf (uval, sizeof (uval), "%s/%s.sock",
uc->service_home, section);
value = uval;
}
uc.system = system;
uc.cfg = cfg;
uc.status = GNUNET_OK;
- GNUNET_asprintf (&uc.service_home, "%s\\%u", system->tmppath,
+ GNUNET_asprintf (&uc.service_home, "%s/%u", system->tmppath,
system->path_counter++);
GNUNET_CONFIGURATION_set_value_string (cfg, "PATHS", "SERVICEHOME",
uc.service_home);
}
GNUNET_assert (GNUNET_OK ==
GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS",
- "SERVICE_HOME",
+ "SERVICEHOME",
&service_home));
- GNUNET_snprintf (hostkey_filename, sizeof (hostkey_filename), "%s\\.hostkey",
+ GNUNET_snprintf (hostkey_filename, sizeof (hostkey_filename), "%s/.hostkey",
service_home);
fd = GNUNET_DISK_file_open (hostkey_filename,
GNUNET_DISK_OPEN_CREATE | GNUNET_DISK_OPEN_WRITE,
return NULL;
}
GNUNET_DISK_file_close (fd);
- GNUNET_asprintf (&config_filename, "%s\\config", service_home);
+ GNUNET_asprintf (&config_filename, "%s/config", service_home);
GNUNET_free (service_home);
if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, config_filename))
{
char *hostkeys_file;
data_dir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
- GNUNET_asprintf (&hostkeys_file, "%s\\testing_hostkeys.dat", data_dir);
+ GNUNET_asprintf (&hostkeys_file, "%s/testing_hostkeys.dat", data_dir);
GNUNET_free (data_dir);
system = GNUNET_TESTING_system_create (tmppath, "localhost");
if (NULL == system)