{
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Shutdown of peers failed!\n");
+ "Shutdown of peers failed!\n");
#endif
ok--;
}
{
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: All peers successfully shut down!\n");
+ "All peers successfully shut down!\n");
#endif
}
GNUNET_CONFIGURATION_destroy (testing_cfg);
{
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Ending test.\n");
+ "Ending test.\n");
#endif
if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
disconnect_mesh_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: disconnecting mesh service of peers\n");
+ "disconnecting mesh service of peers\n");
disconnect_task = GNUNET_SCHEDULER_NO_TASK;
if (NULL != t)
{
struct GNUNET_MessageHeader *msg = buf;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: tmt_rdy called\n");
+ " tmt_rdy called\n");
if (size < sizeof (struct GNUNET_MessageHeader) || NULL == buf)
return 0;
msg->size = htons (sizeof (struct GNUNET_MessageHeader));
if (data_sent < 1000)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Scheduling %d packet\n", data_sent);
+ " Scheduling %d packet\n", data_sent);
GNUNET_SCHEDULER_add_now(&data_task, NULL);
}
}
switch (client)
{
case 1L:
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Origin client got a response!\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Origin client got a response!\n");
ok++;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
peers_responded++;
data_ack++;
if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
return GNUNET_OK;
if (test == SPEED_ACK)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: received ack %u\n", data_ack);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ " received ack %u\n", data_ack);
GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0,
GNUNET_TIME_UNIT_FOREVER_REL, sender,
sizeof (struct GNUNET_MessageHeader),
GAUGER ("MESH", "Tunnel 5 peers", 1000000.0 / total_time.rel_value,
"packets/s");
}
- GNUNET_MESH_tunnel_destroy (tunnel);
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
- {
- GNUNET_SCHEDULER_cancel (disconnect_task);
- disconnect_task =
- GNUNET_SCHEDULER_add_now (&disconnect_mesh_peers,
- NULL);
- }
+ GNUNET_assert (tunnel == t);
+ GNUNET_MESH_tunnel_destroy (t);
+ t = NULL;
break;
case 2L:
case 3L:
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Destination client %u got a message.\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Destination client %u got a message.\n",
client);
ok++;
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
if (SPEED != test)
{
GNUNET_MESH_notify_transmit_ready (tunnel, GNUNET_NO, 0,
else
{
data_received++;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: received data %u\n", data_received);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ " received data %u\n", data_received);
if (data_received < 1000)
return GNUNET_OK;
}
const struct GNUNET_PeerIdentity *initiator,
const struct GNUNET_ATS_Information *atsi)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Incoming tunnel from %s to peer %d\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Incoming tunnel from %s to peer %d\n",
GNUNET_i2s (initiator), (long) cls);
ok++;
- if ((long) cls == 1L)
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
+ if ((long) cls == 2L)
incoming_t = tunnel;
- else
+ else if ((long) cls == 3L)
incoming_t2 = tunnel;
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Incoming tunnel for unknown client %lu\n", (long) cls);
+ }
if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
{
long i = (long) cls;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Incoming tunnel disconnected at peer %d\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Incoming tunnel disconnected at peer %d\n",
i);
if (2L == i)
+ {
ok++;
+ incoming_t = NULL;
+ }
else if (3L == i)
+ {
ok++;
+ incoming_t2 = NULL;
+ }
else
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Unknown peer! %d\n", i);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Unknown peer! %d\n", i);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
peers_in_tunnel--;
if (peers_in_tunnel > 0)
return;
dh (void *cls, const struct GNUNET_PeerIdentity *peer)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: peer %s disconnected\n",
+ "peer %s disconnected\n",
GNUNET_i2s (peer));
return;
}
{
struct GNUNET_PeerIdentity *dest;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: peer %s connected\n", GNUNET_i2s (peer));
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "peer %s connected\n", GNUNET_i2s (peer));
if (0 == memcmp (&d2->id, peer, sizeof (d2->id)) && (long) cls == 1L)
+ {
ok++;
+ }
if (test == MULTICAST && 0 == memcmp (&d3->id, peer, sizeof (d3->id)) &&
(long) cls == 1L)
+ {
ok++;
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
switch (test)
{
case UNICAST:
disconnect_task =
GNUNET_SCHEDULER_add_delayed (SHORT_TIME, &disconnect_mesh_peers, NULL);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Sending data...\n");
+ "Sending data...\n");
peers_responded = 0;
data_ack = 0;
data_received = 0;
else
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Disconnect already run?\n");
+ "Disconnect already run?\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Aborting...\n");
+ "Aborting...\n");
}
return;
}
static void
do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: test_task\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test_task\n");
if (test == MULTICAST)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: add peer 3\n");
+ "add peer 3\n");
GNUNET_MESH_peer_request_connect_add (t, &d3->id);
}
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: add peer 2\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "add peer 2\n");
GNUNET_MESH_peer_request_connect_add (t, &d2->id);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: schedule timeout in 90s\n");
+ "schedule timeout in 90s\n");
if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
GNUNET_MESH_ApplicationType app;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: connect_mesh_service\n");
+ "connect_mesh_service\n");
d2 = GNUNET_TESTING_daemon_get (pg, 4);
if (test == MULTICAST)
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: connecting to mesh service of peer %s\n",
+ "connecting to mesh service of peer %s\n",
GNUNET_i2s (&d1->id));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: connecting to mesh service of peer %s\n",
+ "connecting to mesh service of peer %s\n",
GNUNET_i2s (&d2->id));
if (test == MULTICAST)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: connecting to mesh service of peer %s\n",
+ "connecting to mesh service of peer %s\n",
GNUNET_i2s (&d3->id));
}
#endif
if (emsg != NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Peergroup callback called with error, aborting test!\n");
+ "Peergroup callback called with error, aborting test!\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Error from testing: `%s'\n", emsg);
+ "Error from testing: `%s'\n", emsg);
ok--;
GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"************************************************************\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Peer Group started successfully!\n");
+ "Peer Group started successfully!\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Have %u connections\n",
+ "Have %u connections\n",
total_connections);
#endif
d1 = GNUNET_TESTING_daemon_get (pg, i);
peer_id = GNUNET_PEER_intern (&d1->id);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: %u: %s\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " %u: %s\n",
peer_id, GNUNET_i2s (&d1->id));
}
d1 = GNUNET_TESTING_daemon_get (pg, 0);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Peer looking: %s\n",
+ "Peer looking: %s\n",
GNUNET_i2s (&d1->id));
pid1 = GNUNET_PEER_intern (&d1->id);
else
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Problem with new connection (%s)\n",
+ "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));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " (%s)\n", GNUNET_i2s (first));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " (%s)\n", GNUNET_i2s (second));
}
}
#if VERBOSE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "test: Starting daemons.\n");
+ "Starting daemons.\n");
GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing",
"use_progressbars", "YES");
#endif
*/
int ok_goal;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Start\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start\n");
if (strstr (argv[0], "test_mesh_small_unicast") != NULL)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: UNICAST\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "UNICAST\n");
test = UNICAST;
ok_goal = 5;
}
else if (strstr (argv[0], "test_mesh_small_multicast") != NULL)
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: MULTICAST\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MULTICAST\n");
test = MULTICAST;
ok_goal = 10;
}
* _________________________________
* 5 x ok expected per peer
*/
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: SPEED_ACK\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED_ACK\n");
test = SPEED_ACK;
ok_goal = 2003;
argv2 [3] = NULL; // remove -L DEBUG
* _________________________________
* 5 x ok expected per peer
*/
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: SPEED\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "SPEED\n");
test = SPEED;
ok_goal = 1003;
}
else
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: UNKNOWN\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "UNKNOWN\n");
test = SETUP;
ok_goal = 0;
}
if (ok_goal > ok)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "test: FAILED! (%d/%d)\n", ok, ok_goal);
+ "FAILED! (%d/%d)\n", ok, ok_goal);
return 1;
}
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: success\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "success\n");
return 0;
}