[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r8355 - GNUnet/src/applications/testing
From: |
gnunet |
Subject: |
[GNUnet-SVN] r8355 - GNUnet/src/applications/testing |
Date: |
Sun, 29 Mar 2009 20:57:09 -0600 |
Author: nevans
Date: 2009-03-29 20:57:09 -0600 (Sun, 29 Mar 2009)
New Revision: 8355
Modified:
GNUnet/src/applications/testing/remote.c
GNUnet/src/applications/testing/remote.h
GNUnet/src/applications/testing/remotetopologies.c
Log:
logging changes
Modified: GNUnet/src/applications/testing/remote.c
===================================================================
--- GNUnet/src/applications/testing/remote.c 2009-03-30 02:55:40 UTC (rev
8354)
+++ GNUnet/src/applications/testing/remote.c 2009-03-30 02:57:09 UTC (rev
8355)
@@ -27,8 +27,6 @@
#include "remote.h"
#include "remotetopologies.c"
-#define VERBOSE GNUNET_NO
-
/* Yes this is ugly, but for now it is nice to
* have a linked list and an array
*/
@@ -83,7 +81,9 @@
* if this is contested by anyone, please mark it here as well as how it
should be
* done, and I can change it everywhere else by example! NE
*/
+#if VERBOSE
fprintf (stderr, _("cp command is : %s \n"), cmd);
+#endif
system (cmd);
GNUNET_free (cmd);
@@ -107,7 +107,9 @@
username, hostname, gnunetd_home, remote_config_path,
configFileName);
}
+#if VERBOSE
fprintf (stderr, _("exec command is : %s \n"), cmd);
+#endif
system (cmd);
GNUNET_free (cmd);
@@ -132,8 +134,9 @@
configFileName);
}
-
+#if VERBOSE
fprintf (stderr, _("exec command is : %s \n"), cmd);
+#endif
system (cmd);
@@ -172,13 +175,17 @@
snprintf (cmd, length + 1, "ssh address@hidden cat %s", tokill->username,
tokill->hostname, tokill->pid);
}
+#if VERBOSE
fprintf (stderr, _("exec command is : %s \n"), cmd);
+#endif
output = popen (cmd, "r");
GNUNET_free (cmd);
if (fscanf (output, "%d", &pid) == 1)
{
- fprintf (stderr, "Got pid %d\n", pid);
+#if VERBOSE
+ fprintf (stderr, _("Got pid %d\n"), pid);
+#endif
}
else
{
@@ -201,8 +208,9 @@
tokill->username, tokill->hostname, pid);
}
-
+#if VERBOSE
fprintf (stderr, _("exec command is : %s \n"), cmd);
+#endif
system (cmd);
@@ -708,25 +716,35 @@
switch (type)
{
case GNUNET_REMOTE_CLIQUE:
- fprintf (stderr, "Creating clique topology\n");
+#if VERBOSE
+ fprintf (stderr, _("Creating clique topology\n"));
+#endif
ret = GNUNET_REMOTE_connect_clique (head, dotOutFile);
break;
case GNUNET_REMOTE_SMALL_WORLD:
- fprintf (stderr, "Creating small world topology\n");
+#if VERBOSE
+ fprintf (stderr, _("Creating small world topology\n"));
+#endif
ret = GNUNET_SYSERR;
break;
case GNUNET_REMOTE_RING:
- fprintf (stderr, "Creating ring topology\n");
+#if VERBOSE
+ fprintf (stderr, _("Creating ring topology\n"));
+#endif
ret = GNUNET_REMOTE_connect_ring (head, dotOutFile);
break;
case GNUNET_REMOTE_2D_TORUS:
- fprintf (stderr, "Creating 2d torus topology\n");
+#if VERBOSE
+ fprintf (stderr, _("Creating 2d torus topology\n"));
+#endif
ret =
GNUNET_REMOTE_connect_2d_torus (number_of_daemons, list_as_array,
dotOutFile);
break;
case GNUNET_REMOTE_ERDOS_RENYI:
- fprintf (stderr, "Creating Erdos-Renyi topology\n");
+#if VERBOSE
+ fprintf (stderr, _("Creating Erdos-Renyi topology\n"));
+#endif
ret = GNUNET_REMOTE_connect_erdos_renyi (percentage, head, dotOutFile);
break;
case GNUNET_REMOTE_NONE:
@@ -743,13 +761,17 @@
while (pos != NULL)
{
/* Printing out the friends isn't necessary, but it's nice */
+ #if VERBOSE
fprintf (stderr, _("Friend list of %s:%d\n"), pos->hostname,
pos->port);
+ #endif
temp_friend_handle = fopen ("friend.temp", "wt");
friend_pos = pos->friend_entries;
while (friend_pos != NULL)
{
+ #if VERBOSE
fprintf (stderr, "\t%s\n", (const char *) friend_pos->nodeid);
+ #endif
fprintf (temp_friend_handle, "%s\n",
(const char *) friend_pos->nodeid);
friend_pos = friend_pos->next;
@@ -776,9 +798,10 @@
pos->username, pos->hostname,
pos->remote_friend_file_path);
}
-
+#if VERBOSE
fprintf (stderr, _("scp command for friend file copy is : %s \n"),
cmd);
+#endif
system (cmd);
GNUNET_free (cmd);
pos = pos->next;
@@ -799,10 +822,12 @@
friend_pos = pos->friend_entries;
while (friend_pos != NULL)
{
+#if VERBOSE
fprintf (stderr, _("connecting peer %s:%d to peer %s:%d\n"),
pos->hostname, pos->port,
friend_pos->hostentry->hostname,
friend_pos->hostentry->port);
+#endif
ret = GNUNET_REMOTE_connect_daemons (pos->hostname, pos->port,
friend_pos->hostentry->
hostname,
@@ -818,7 +843,9 @@
}
else
{
- fprintf (stderr, "connect didn't return well!\n");
+#if VERBOSE
+ fprintf (stderr, _("connect didn't return well!\n"));
+#endif
}
Modified: GNUnet/src/applications/testing/remote.h
===================================================================
--- GNUnet/src/applications/testing/remote.h 2009-03-30 02:55:40 UTC (rev
8354)
+++ GNUnet/src/applications/testing/remote.h 2009-03-30 02:57:09 UTC (rev
8355)
@@ -33,6 +33,7 @@
#include "gnunet_util.h"
#include "gnunet_remote_lib.h"
+#define VERBOSE GNUNET_NO
/**
* Linked list of information about daemon processes.
Modified: GNUnet/src/applications/testing/remotetopologies.c
===================================================================
--- GNUnet/src/applications/testing/remotetopologies.c 2009-03-30 02:55:40 UTC
(rev 8354)
+++ GNUnet/src/applications/testing/remotetopologies.c 2009-03-30 02:57:09 UTC
(rev 8355)
@@ -25,8 +25,6 @@
*/
#include "remote.h"
-#define DEBUG GNUNET_YES
-
static int
printInfo (void *data,
const GNUNET_PeerIdentity *
@@ -72,8 +70,10 @@
&node2))
{
temp_rand = ((double) RANDOM () / RAND_MAX);
- fprintf (stderr, "rand is %f probability is %f\n", temp_rand,
+#if VERBOSE
+ fprintf (stderr, _("rand is %f probability is %f\n"), temp_rand,
probability);
+#endif
if (temp_rand < probability)
{
node1temp =
@@ -278,9 +278,11 @@
toggle++;
}
}
+#if VERBOSE
fprintf (stderr,
_("Connecting nodes in 2d torus topology: %u rows %u columns\n"),
rows, cols);
+#endif
/* Rows and columns are all sorted out, now iterate over all nodes and
connect each
* to the node to its right and above. Once this is over, we'll have our
torus!
* Special case for the last node (if the rows and columns are not equal),
connect
@@ -295,8 +297,9 @@
nodeToConnect = rows * cols - cols;
else
nodeToConnect = i - cols + 1;
-
- fprintf (stderr, "connecting node %u to %u\n", i, nodeToConnect);
+#if VERBOSE
+ fprintf (stderr, _("connecting node %u to %u\n"), i, nodeToConnect);
+#endif
GNUNET_REMOTE_get_daemons_information (list_as_array[i]->hostname,
list_as_array[i]->port,
list_as_array
@@ -332,7 +335,9 @@
if (nodeToConnect < number_of_daemons)
{
- fprintf (stderr, "connecting node %u to %u\n", i, nodeToConnect);
+#if VERBOSE
+ fprintf (stderr, _("connecting node %u to %u\n"), i, nodeToConnect);
+#endif
GNUNET_REMOTE_get_daemons_information (list_as_array[i]->hostname,
list_as_array[i]->port,
list_as_array
@@ -414,18 +419,16 @@
GNUNET_snprintf (host, 128, "%s:%u", hostname1, port1);
GNUNET_GC_set_configuration_value_string (cfg1, NULL, "NETWORK", "HOST",
host);
- if (DEBUG == GNUNET_YES)
- {
- fprintf (stderr, "Setting config 1 to host %s\n", host);
- }
+#if VERBOSE
+ fprintf (stderr, _("Setting config 1 to host %s\n"), host);
+#endif
GNUNET_snprintf (host, 128, "%s:%u", hostname2, port2);
GNUNET_GC_set_configuration_value_string (cfg2, NULL, "NETWORK", "HOST",
host);
- if (DEBUG == GNUNET_YES)
- {
- fprintf (stderr, "Setting config 2 to host %s\n", host);
- }
+#if VERBOSE
+ fprintf (stderr, _("Setting config 2 to host %s\n"), host);
+#endif
if ((GNUNET_OK ==
GNUNET_wait_for_daemon_running (NULL, cfg1, 30 * GNUNET_CRON_SECONDS))
@@ -436,7 +439,9 @@
sock1 = GNUNET_client_connection_create (NULL, cfg1);
sock2 = GNUNET_client_connection_create (NULL, cfg2);
ret = -20;
+#if VERBOSE
fprintf (stderr, _("Waiting for peers to connect"));
+#endif
h1 = NULL;
h2 = NULL;
while ((ret++ < -1) && (GNUNET_shutdown_test () == GNUNET_NO))
@@ -478,16 +483,17 @@
if (ret != GNUNET_OK)
{
+#if VERBOSE
fprintf (stderr,
- "\nFailed to connect `%s' and `%s'\n",
+ _("\nFailed to connect `%s' and `%s'\n"),
(const char *) host1entry, (const char *) host2entry);
- fprintf (stderr, "Connections of `%s':\n",
+ fprintf (stderr, _("Connections of `%s':\n"),
(const char *) host1entry);
GNUNET_IDENTITY_request_peer_infos (sock1, &printInfo, NULL);
- fprintf (stderr, "Connections of `%s':\n",
+ fprintf (stderr, _("Connections of `%s':\n"),
(const char *) host2entry);
GNUNET_IDENTITY_request_peer_infos (sock2, &printInfo, NULL);
-
+#endif
}
if (dotOutFile != NULL)
{
@@ -498,13 +504,17 @@
fprintf (dotOutFile, "%s;\n", buf);
GNUNET_free (buf);
}
+#if VERBOSE
fprintf (stderr, "%s\n", ret == GNUNET_OK ? "Connected nodes." : "?");
+#endif
GNUNET_client_connection_destroy (sock1);
GNUNET_client_connection_destroy (sock2);
}
else
{
- fprintf (stderr, "Failed to establish connection with peers.\n");
+#if VERBOSE
+ fprintf (stderr, _("Failed to establish connection with peers.\n"));
+#endif
}
GNUNET_GC_free (cfg1);
GNUNET_GC_free (cfg2);
@@ -571,7 +581,9 @@
}
else
{
+#if VERBOSE
fprintf (stderr, _("Failed to establish connection with peers.\n"));
+#endif
}
GNUNET_GC_free (cfg1);
GNUNET_GC_free (cfg2);
@@ -624,7 +636,9 @@
}
else
{
+#if VERBOSE
fprintf (stderr, _("Failed to establish connection with peers.\n"));
+#endif
}
GNUNET_GC_free (cfg1);
if (ret != GNUNET_SYSERR)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r8355 - GNUnet/src/applications/testing,
gnunet <=