aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/test_mesh_small.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh/test_mesh_small.c')
-rw-r--r--src/mesh/test_mesh_small.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c
index 3f9e1c2ae..80edad496 100644
--- a/src/mesh/test_mesh_small.c
+++ b/src/mesh/test_mesh_small.c
@@ -29,7 +29,6 @@
29#include <gauger.h> 29#include <gauger.h>
30 30
31 31
32#define VERBOSE GNUNET_YES
33#define REMOVE_DIR GNUNET_YES 32#define REMOVE_DIR GNUNET_YES
34 33
35struct MeshPeer 34struct MeshPeer
@@ -289,18 +288,14 @@ shutdown_callback (void *cls, const char *emsg)
289{ 288{
290 if (emsg != NULL) 289 if (emsg != NULL)
291 { 290 {
292#if VERBOSE
293 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 291 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
294 "Shutdown of peers failed!\n"); 292 "Shutdown of peers failed!\n");
295#endif
296 ok--; 293 ok--;
297 } 294 }
298 else 295 else
299 { 296 {
300#if VERBOSE
301 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 297 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
302 "All peers successfully shut down!\n"); 298 "All peers successfully shut down!\n");
303#endif
304 } 299 }
305 GNUNET_CONFIGURATION_destroy (testing_cfg); 300 GNUNET_CONFIGURATION_destroy (testing_cfg);
306} 301}
@@ -315,11 +310,8 @@ shutdown_callback (void *cls, const char *emsg)
315static void 310static void
316shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 311shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
317{ 312{
318#if VERBOSE
319 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 313 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
320 "Ending test.\n"); 314 "Ending test.\n");
321#endif
322
323 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK) 315 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
324 { 316 {
325 GNUNET_SCHEDULER_cancel (disconnect_task); 317 GNUNET_SCHEDULER_cancel (disconnect_task);
@@ -877,7 +869,6 @@ connect_mesh_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
877 } 869 }
878 app = (GNUNET_MESH_ApplicationType) 0; 870 app = (GNUNET_MESH_ApplicationType) 0;
879 871
880#if VERBOSE
881 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 872 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
882 "connecting to mesh service of peer %s\n", 873 "connecting to mesh service of peer %s\n",
883 GNUNET_i2s (&d1->id)); 874 GNUNET_i2s (&d1->id));
@@ -890,7 +881,6 @@ connect_mesh_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
890 "connecting to mesh service of peer %s\n", 881 "connecting to mesh service of peer %s\n",
891 GNUNET_i2s (&d3->id)); 882 GNUNET_i2s (&d3->id));
892 } 883 }
893#endif
894 h1 = GNUNET_MESH_connect (d1->cfg, (void *) 1L, NULL, &tunnel_cleaner, 884 h1 = GNUNET_MESH_connect (d1->cfg, (void *) 1L, NULL, &tunnel_cleaner,
895 handlers, &app); 885 handlers, &app);
896 h2 = GNUNET_MESH_connect (d2->cfg, (void *) 2L, &incoming_tunnel, 886 h2 = GNUNET_MESH_connect (d2->cfg, (void *) 2L, &incoming_tunnel,
@@ -943,16 +933,9 @@ peergroup_ready (void *cls, const char *emsg)
943 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); 933 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
944 return; 934 return;
945 } 935 }
946#if VERBOSE
947 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
948 "************************************************************\n");
949 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
950 "Peer Group started successfully!\n");
951 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 936 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
952 "Have %u connections\n", 937 "Peer Group started successfully with %u connections\n",
953 total_connections); 938 total_connections);
954#endif
955
956 if (data_file != NULL) 939 if (data_file != NULL)
957 { 940 {
958 buf = NULL; 941 buf = NULL;
@@ -1041,20 +1024,11 @@ run (void *cls, char *const *args, const char *cfgfile,
1041 testing_cfg = GNUNET_CONFIGURATION_dup (cfg); 1024 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
1042 1025
1043 GNUNET_log_setup ("test_mesh_small", 1026 GNUNET_log_setup ("test_mesh_small",
1044#if VERBOSE
1045 "DEBUG",
1046#else
1047 "WARNING", 1027 "WARNING",
1048#endif
1049 NULL); 1028 NULL);
1050 1029
1051#if VERBOSE
1052 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1030 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1053 "Starting daemons.\n"); 1031 "Starting daemons.\n");
1054 GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing_old",
1055 "use_progressbars", "YES");
1056#endif
1057
1058 if (GNUNET_OK != 1032 if (GNUNET_OK !=
1059 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing_old", 1033 GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing_old",
1060 "num_peers", &num_peers)) 1034 "num_peers", &num_peers))
@@ -1152,10 +1126,6 @@ main (int argc, char *argv[])
1152 argv[0], 1126 argv[0],
1153 "-c", 1127 "-c",
1154 "test_mesh_small.conf", 1128 "test_mesh_small.conf",
1155#if VERBOSE
1156 "-L",
1157 "DEBUG",
1158#endif
1159 NULL 1129 NULL
1160 }; 1130 };
1161 int argc2 = (sizeof (argv2) / sizeof (char *)) - 1; 1131 int argc2 = (sizeof (argv2) / sizeof (char *)) - 1;
@@ -1193,9 +1163,6 @@ main (int argc, char *argv[])
1193 test_name = "speed ack"; 1163 test_name = "speed ack";
1194 ok_goal = TOTAL_PACKETS * 2 + 3; 1164 ok_goal = TOTAL_PACKETS * 2 + 3;
1195 argv2 [3] = NULL; // remove -L DEBUG 1165 argv2 [3] = NULL; // remove -L DEBUG
1196#if VERBOSE
1197 argc2 -= 2;
1198#endif
1199 } 1166 }
1200 else if (strstr (argv[0], "test_mesh_small_speed") != NULL) 1167 else if (strstr (argv[0], "test_mesh_small_speed") != NULL)
1201 { 1168 {