make writing data_output optional and disable by default
authorChristian Grothoff <christian@grothoff.org>
Sun, 23 Oct 2011 13:35:03 +0000 (13:35 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 23 Oct 2011 13:35:03 +0000 (13:35 +0000)
src/dht/test_dht_2dtorus.c
src/dht/test_dht_2dtorus.conf
src/mesh/test_mesh_small.c
src/mesh/test_mesh_small.conf
src/mesh/test_mesh_small_unicast_far.c
src/nse/gnunet-nse-profiler.c
src/nse/nse_profiler_test.conf

index cc2520580cc144f8d6199ebc3c33f35edb9a36f7..1cc0e7980637d41409d5cba64a2ea4eab6706b11 100644 (file)
@@ -103,8 +103,6 @@ static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
 
 static char *topology_file;
 
-static char *data_filename;
-
 struct GNUNET_TESTING_Daemon *d1;
 
 struct GNUNET_TESTING_Daemon *d2;
@@ -472,6 +470,7 @@ run (void *cls, char *const *args, const char *cfgfile,
 {
   char *temp_str;
   struct GNUNET_TESTING_Host *hosts;
+  char *data_filename;
 
   ok = 1;
   testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
@@ -509,27 +508,23 @@ run (void *cls, char *const *args, const char *cfgfile,
     return;
   }
 
-  if (GNUNET_OK !=
+  if (GNUNET_OK ==
       GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_dht_2dtorus",
                                              "data_output_file",
                                              &data_filename))
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Option test_dht_2d:data_output_file is required!\n");
-    return;
-  }
-
-  data_file =
+    data_file =
       GNUNET_DISK_file_open (data_filename,
                              GNUNET_DISK_OPEN_READWRITE |
                              GNUNET_DISK_OPEN_CREATE,
                              GNUNET_DISK_PERM_USER_READ |
                              GNUNET_DISK_PERM_USER_WRITE);
-  if (data_file == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
-                data_filename);
-    GNUNET_free (data_filename);
+    if (data_file == NULL)
+      {
+       GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
+                   data_filename);
+       GNUNET_free (data_filename);
+      }
   }
 
   if (GNUNET_YES ==
index e49810569fa9bb983544d61585f05ca9aab006c5..20ca30e3f2d9cda2d4f43e35aca173dd691e9ce0 100644 (file)
@@ -75,4 +75,4 @@ DELETE_FILES = YES
 
 [test_dht_2dtorus]
 CONNECTION_LIMIT = 16
-DATA_OUTPUT_FILE=data_output
+#DATA_OUTPUT_FILE=data_output
index f100a40e499b1a2d4b7f0df964a31e4cd2e534e9..0888c1e000a04429be56bef3705b0f52d4b9a72c 100644 (file)
@@ -140,8 +140,6 @@ static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
 
 static char *topology_file;
 
-static char *data_filename;
-
 static struct GNUNET_TESTING_Daemon *d1;
 
 static GNUNET_PEER_Id pid1;
@@ -753,6 +751,7 @@ run (void *cls, char *const *args, const char *cfgfile,
   char *temp_str;
   unsigned long long temp_wait;
   struct GNUNET_TESTING_Host *hosts;
+  char *data_filename;
 
   ok = 0;
   testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
@@ -801,27 +800,23 @@ run (void *cls, char *const *args, const char *cfgfile,
     return;
   }
 
-  if (GNUNET_OK !=
+  if (GNUNET_OK ==
       GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small",
                                              "data_output_file",
                                              &data_filename))
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Option test_mesh_small:data_output_file is required!\n");
-    return;
-  }
-
-  data_file =
+    data_file =
       GNUNET_DISK_file_open (data_filename,
                              GNUNET_DISK_OPEN_READWRITE |
                              GNUNET_DISK_OPEN_CREATE,
                              GNUNET_DISK_PERM_USER_READ |
                              GNUNET_DISK_PERM_USER_WRITE);
-  if (data_file == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
-                data_filename);
-    GNUNET_free (data_filename);
+    if (data_file == NULL)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
+                 data_filename);
+      GNUNET_free (data_filename);
+    }
   }
 
   wait_time =
index f98dca7dc3e0f97d1e1a0c026a91d36e2348c9c9..9e340aacbf645b6318359b5c03805f0bd2edf814 100644 (file)
@@ -87,4 +87,4 @@ DELETE_FILES = YES
 [test_mesh_small]
 WAIT_TIME = 300
 CONNECTION_LIMIT = 16
-DATA_OUTPUT_FILE=data_output
+#DATA_OUTPUT_FILE=data_output
index d5a768f98cffe15637b4a886071524f12a8131cb..f5bab6fb4c1eb406f55e81fa012191170c7a9caa 100644 (file)
@@ -120,8 +120,6 @@ static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
 
 static char *topology_file;
 
-static char *data_filename;
-
 static struct GNUNET_TESTING_Daemon *d1;
 
 static struct GNUNET_TESTING_Daemon *d2;
@@ -460,6 +458,8 @@ run (void *cls, char *const *args, const char *cfgfile,
   char *temp_str;
   unsigned long long temp_wait;
   struct GNUNET_TESTING_Host *hosts;
+  char *data_filename;
+
 
   ok = 1;
   testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
@@ -516,27 +516,23 @@ run (void *cls, char *const *args, const char *cfgfile,
     return;
   }
 
-  if (GNUNET_OK !=
+  if (GNUNET_OK ==
       GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small",
                                              "data_output_file",
                                              &data_filename))
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Option test_mesh_small:data_output_file is required!\n");
-    return;
-  }
-
-  data_file =
+    data_file =
       GNUNET_DISK_file_open (data_filename,
                              GNUNET_DISK_OPEN_READWRITE |
                              GNUNET_DISK_OPEN_CREATE,
                              GNUNET_DISK_PERM_USER_READ |
                              GNUNET_DISK_PERM_USER_WRITE);
-  if (data_file == NULL)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
-                data_filename);
-    GNUNET_free (data_filename);
+    if (data_file == NULL)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
+                 data_filename);
+      GNUNET_free (data_filename);
+    }
   }
 
   wait_time =
index a18a13fbddf249da07893c8b5cde57ed080a67e6..ecd594e869359c9d12fc138eaf84b5d280190d04 100644 (file)
@@ -137,8 +137,6 @@ static GNUNET_SCHEDULER_TaskIdentifier churn_task;
 
 static char *topology_file;
 
-static char *data_filename;
-
 static uint64_t clock_skew;
 
 /**
@@ -540,6 +538,7 @@ run (void *cls, char *const *args, const char *cfgfile,
   char *temp_str;
   unsigned long long temp_wait;
   struct GNUNET_TESTING_Host *hosts;
+  char *data_filename;
 
   ok = 1;
   testing_cfg = GNUNET_CONFIGURATION_create ();
@@ -584,14 +583,21 @@ run (void *cls, char *const *args, const char *cfgfile,
     return;
   }
 
-  if (GNUNET_OK !=
+  if (GNUNET_OK ==
       GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler",
                                              "data_output_file",
                                              &data_filename))
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Option nse-profiler:data_output_file is required!\n");
-    return;
+    data_file =
+      GNUNET_DISK_file_open (data_filename,
+                             GNUNET_DISK_OPEN_READWRITE |
+                             GNUNET_DISK_OPEN_CREATE,
+                             GNUNET_DISK_PERM_USER_READ |
+                             GNUNET_DISK_PERM_USER_WRITE);
+    if (data_file == NULL)
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
+                 data_filename);
+    GNUNET_free (data_filename);
   }
 
   if (GNUNET_YES ==
@@ -605,17 +611,6 @@ run (void *cls, char *const *args, const char *cfgfile,
   }
 
 
-  data_file =
-      GNUNET_DISK_file_open (data_filename,
-                             GNUNET_DISK_OPEN_READWRITE |
-                             GNUNET_DISK_OPEN_CREATE,
-                             GNUNET_DISK_PERM_USER_READ |
-                             GNUNET_DISK_PERM_USER_WRITE);
-  if (data_file == NULL)
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
-                data_filename);
-  GNUNET_free (data_filename);
-
   wait_time =
       GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_wait);
 
index ad113b24f7a321d2662e6b81e80b1ee17573ac98..411bad9f0f47a226a5284bb40e4b07fe4fdf2b0f 100644 (file)
@@ -98,7 +98,7 @@ DELETE_FILES = NO
 [nse-profiler]
 #OUTPUT_FILE = nse_output_100_peers.dat
 TOPOLOGY_OUTPUT_FILE = nse_topo_100_peers
-DATA_OUTPUT_FILE = nse_topo_100_peers_stats
+#DATA_OUTPUT_FILE = nse_topo_100_peers_stats
 #ROUND0 = 90
 #ROUND1 = 100
 #ROUND2 = 50