summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_testing_2dtorus.c57
-rw-r--r--src/testing/test_testing_large_topology.c2
-rw-r--r--src/testing/test_testing_topology.c4
-rw-r--r--src/testing/test_testing_topology_blacklist.c2
-rw-r--r--src/testing/testing.c23
-rw-r--r--src/testing/testing_group.c21
-rw-r--r--src/testing/testing_peergroup.c18
7 files changed, 54 insertions, 73 deletions
diff --git a/src/testing/test_testing_2dtorus.c b/src/testing/test_testing_2dtorus.c
index f1ddff0ea..7b109bca4 100644
--- a/src/testing/test_testing_2dtorus.c
+++ b/src/testing/test_testing_2dtorus.c
@@ -104,8 +104,7 @@ shutdown_callback (void *cls, const char *emsg)
if (emsg != NULL)
{
#if VERBOSE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Shutdown of peers failed!\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Shutdown of peers failed!\n");
#endif
ok--;
}
@@ -123,8 +122,7 @@ static void
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
#if VERBOSE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Ending test.\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Ending test.\n");
#endif
GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
@@ -135,8 +133,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
disconnect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: disconnecting peers\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: disconnecting peers\n");
if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle)
{
@@ -163,33 +160,26 @@ topo_cb (void *cls, const struct GNUNET_PeerIdentity *first,
topo_connections++;
if (NULL != emsg)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "test: Error by topo %u: %s\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: Error by topo %u: %s\n",
topo_connections, emsg);
}
else
{
if (first == NULL || second == NULL)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Connection %u NULL\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Connection %u NULL\n",
topo_connections);
if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
- GNUNET_SCHEDULER_add_now(&disconnect_peers, NULL);
+ GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL);
}
return;
}
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Connection %u ok\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Connection %u ok\n",
topo_connections);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: %s\n",
- GNUNET_i2s (first));
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: %s\n",
- GNUNET_i2s (second));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: %s\n", GNUNET_i2s (first));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: %s\n", GNUNET_i2s (second));
}
}
@@ -206,8 +196,8 @@ peergroup_ready (void *cls, const char *emsg)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"test: Peergroup callback called with error, aborting test!\n");
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Error from testing: `%s'\n", emsg);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Error from testing: `%s'\n",
+ emsg);
ok--;
GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
return;
@@ -217,8 +207,7 @@ peergroup_ready (void *cls, const char *emsg)
"************************************************************\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"test: Peer Group started successfully!\n");
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Have %u connections\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Have %u connections\n",
total_connections);
#endif
@@ -226,8 +215,7 @@ peergroup_ready (void *cls, const char *emsg)
if (0 < failed_connections)
{
ok = GNUNET_SYSERR;
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "test: %u connections have FAILED!\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "test: %u connections have FAILED!\n",
failed_connections);
disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL);
@@ -273,12 +261,9 @@ connect_cb (void *cls, const struct GNUNET_PeerIdentity *first,
{
failed_connections++;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Problem with new connection (%s)\n",
- emsg);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n",
- GNUNET_i2s (first));
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n",
- GNUNET_i2s (second));
+ "test: Problem with new connection (%s)\n", emsg);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n", GNUNET_i2s (first));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n", GNUNET_i2s (second));
}
}
@@ -311,8 +296,7 @@ run (void *cls, char *const *args, const char *cfgfile,
NULL);
#if VERBOSE
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Starting daemons.\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Starting daemons.\n");
GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
"use_progressbars", "YES");
#endif
@@ -371,15 +355,14 @@ main (int argc, char *argv[])
GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2,
"test_testing_2dtorus",
- gettext_noop ("Test testing 2d torus."), options,
- &run, NULL);
+ gettext_noop ("Test testing 2d torus."), options, &run,
+ NULL);
#if REMOVE_DIR
GNUNET_DISK_directory_remove ("/tmp/test_testing_2dtorus");
#endif
if (GNUNET_OK != ok)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "test: FAILED!\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: FAILED!\n");
return 1;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: success\n");
diff --git a/src/testing/test_testing_large_topology.c b/src/testing/test_testing_large_topology.c
index a27154507..08b1df5b9 100644
--- a/src/testing/test_testing_large_topology.c
+++ b/src/testing/test_testing_large_topology.c
@@ -1045,7 +1045,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "SETTLE_TIME",
- &settle_time))
+ &settle_time))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
"testing", "SETTLE_TIME");
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index ba092220a..f60ac3a1a 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -1102,7 +1102,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "SETTLE_TIME",
- &settle_time))
+ &settle_time))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
"testing", "SETTLE_TIME");
@@ -1111,7 +1111,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT",
- &connect_timeout))
+ &connect_timeout))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
"testing", "CONNECT_TIMEOUT");
diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c
index d53fc8cbe..d45d1bbb4 100644
--- a/src/testing/test_testing_topology_blacklist.c
+++ b/src/testing/test_testing_topology_blacklist.c
@@ -486,7 +486,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT",
- &connect_timeout))
+ &connect_timeout))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
"testing", "CONNECT_TIMEOUT");
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 9ba58de61..d7f6946b0 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -65,8 +65,7 @@ static struct GNUNET_CORE_MessageHandler no_handlers[] = { {NULL, 0, 0} };
#if EMPTY_HACK
static int
-test_address (void *cls,
- const struct GNUNET_HELLO_Address *address,
+test_address (void *cls, const struct GNUNET_HELLO_Address *address,
struct GNUNET_TIME_Absolute expiration)
{
int *empty = cls;
@@ -108,7 +107,7 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message)
#endif
GNUNET_assert (daemon->phase == SP_GET_HELLO ||
daemon->phase == SP_START_DONE);
- daemon->cb = NULL; // FIXME: why??? (see fsm:SP_START_CORE, notify_daemon_started)
+ daemon->cb = NULL; // FIXME: why??? (see fsm:SP_START_CORE, notify_daemon_started)
if (daemon->task != GNUNET_SCHEDULER_NO_TASK) /* Assertion here instead? */
GNUNET_SCHEDULER_cancel (daemon->task);
@@ -551,9 +550,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_free_non_null (d->username);
GNUNET_free (d->proc);
// GNUNET_free (d); // FIXME (could this leak)
- d->hostname = NULL; // Quick hack to avoid crashing (testing need to be
- d->cfg = NULL; // overhauled anyway, and the error managing is
- // pretty broken anyway.
+ d->hostname = NULL; // Quick hack to avoid crashing (testing need to be
+ d->cfg = NULL; // overhauled anyway, and the error managing is
+ // pretty broken anyway.
return;
}
/* wait some more */
@@ -2037,8 +2036,7 @@ reattempt_daemons_connect (void *cls,
if (NULL != ctx->d2->hello)
{
#if DEBUG_TESTING_RECONNECT
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "updating %s's HELLO\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "updating %s's HELLO\n",
ctx->d2->shortname);
#endif
GNUNET_free (ctx->d2->hello);
@@ -2059,8 +2057,7 @@ reattempt_daemons_connect (void *cls,
#if DEBUG_TESTING_RECONNECT
else
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "didn't have %s's HELLO\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "didn't have %s's HELLO\n",
ctx->d2->shortname);
}
#endif
@@ -2103,8 +2100,7 @@ reattempt_daemons_connect (void *cls,
if (ctx->send_hello == GNUNET_YES)
{
#if DEBUG_TESTING_RECONNECT
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Sending %s's HELLO to %s\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending %s's HELLO to %s\n",
ctx->d1->shortname, ctx->d2->shortname);
#endif
ctx->d1th =
@@ -2126,8 +2122,7 @@ reattempt_daemons_connect (void *cls,
else
{
#if DEBUG_TESTING_RECONNECT
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Trying to reconnect %s to %s\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to reconnect %s to %s\n",
ctx->d1->shortname, ctx->d2->shortname);
#endif
GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id);
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index f22bb2bff..26aac5e7c 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -5554,7 +5554,7 @@ internal_startup_callback (void *cls, const struct GNUNET_PeerIdentity *id,
* Calls GNUNET_TESTING_daemon_continue_startup to set the daemon's state
* from HOSTKEY_CREATED to TOPOLOGY_SETUP. Makes sure not to saturate a host
* with requests delaying them when needed.
- *
+ *
* @param cls closure: internal context of the daemon.
* @param tc TaskContext
*/
@@ -5563,6 +5563,7 @@ internal_continue_startup (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct InternalStartContext *internal_context = cls;
+
internal_context->peer->startup_task = GNUNET_SCHEDULER_NO_TASK;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
@@ -5586,9 +5587,11 @@ internal_continue_startup (void *cls,
}
else
{
- internal_context->peer->startup_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
- (GNUNET_TIME_UNIT_MILLISECONDS, 100),
- &internal_continue_startup, internal_context);
+ internal_context->peer->startup_task =
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
+ (GNUNET_TIME_UNIT_MILLISECONDS, 100),
+ &internal_continue_startup,
+ internal_context);
}
}
@@ -5894,16 +5897,18 @@ GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg)
pg->starting = 0;
for (i = 0; i < pg->total; i++)
{
- pg->peers[i].startup_task = GNUNET_SCHEDULER_add_now (&internal_continue_startup,
- &pg->peers[i].internal_context);
+ pg->peers[i].startup_task =
+ GNUNET_SCHEDULER_add_now (&internal_continue_startup,
+ &pg->peers[i].internal_context);
}
}
#else
pg->starting = 0;
for (i = 0; i < pg->total; i++)
{
- pg->peers[i].startup_task = GNUNET_SCHEDULER_add_now (&internal_continue_startup,
- &pg->peers[i].internal_context);
+ pg->peers[i].startup_task =
+ GNUNET_SCHEDULER_add_now (&internal_continue_startup,
+ &pg->peers[i].internal_context);
}
#endif
}
diff --git a/src/testing/testing_peergroup.c b/src/testing/testing_peergroup.c
index aee9b8a50..1d9d3ba88 100644
--- a/src/testing/testing_peergroup.c
+++ b/src/testing/testing_peergroup.c
@@ -46,7 +46,7 @@ struct PeerGroupStartupContext
unsigned int total;
unsigned int peers_left;
unsigned long long max_concurrent_connections;
-
+
/**
* Maximum attemps to connect two daemons.
*/
@@ -56,7 +56,7 @@ struct PeerGroupStartupContext
* How long to spend trying to establish all the connections?
*/
struct GNUNET_TIME_Relative connect_timeout;
-
+
unsigned long long max_concurrent_ssh;
struct GNUNET_TIME_Absolute timeout;
GNUNET_TESTING_NotifyConnection connect_cb;
@@ -508,7 +508,7 @@ internal_peers_started_callback (void *cls,
pg_start_ctx->connect_topology,
pg_start_ctx->connect_topology_option,
pg_start_ctx->connect_topology_option_modifier,
- pg_start_ctx->connect_timeout,
+ pg_start_ctx->connect_timeout,
pg_start_ctx->connect_attempts, NULL,
NULL);
@@ -755,9 +755,9 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT",
- &pg_start_ctx->connect_timeout))
+ &pg_start_ctx->connect_timeout))
{
- pg_start_ctx->connect_timeout = DEFAULT_CONNECT_TIMEOUT;
+ pg_start_ctx->connect_timeout = DEFAULT_CONNECT_TIMEOUT;
}
if (GNUNET_OK !=
@@ -794,17 +794,15 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
}
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_time (cfg, "testing",
- "PEERGROUP_TIMEOUT",
- &rtimeout))
+ GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "PEERGROUP_TIMEOUT",
+ &rtimeout))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n",
"testing", "PEERGROUP_TIMEOUT");
GNUNET_free (pg_start_ctx);
return NULL;
}
- pg_start_ctx->timeout =
- GNUNET_TIME_relative_to_absolute (rtimeout);
+ pg_start_ctx->timeout = GNUNET_TIME_relative_to_absolute (rtimeout);
/* Read topology related options from the configuration file */