allow user to configure no deletion with testing
authorChristian Grothoff <christian@grothoff.org>
Mon, 25 Jul 2011 14:11:35 +0000 (14:11 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 25 Jul 2011 14:11:35 +0000 (14:11 +0000)
contrib/defaults.conf
src/testing/testing_group.c

index 26d5d623766b8aec1f23d29035e38a21e5df264d..86c6a25edf535e98aab80b7769a8954cf86e11cd 100644 (file)
@@ -18,6 +18,9 @@ CONNECT_ATTEMPTS = 3
 # How many connections can happen simultaneously?
 MAX_OUTSTANDING_CONNECTIONS = 50
 
+# Should we clean up the files on peer group shutdown?
+DELETE_FILES = YES
+
 [client]
 HOME = $SERVICEHOME
 
index f2442aade5eb55bb94d3af07cbb22fe098289f3d..e7be22a8a158ed51054f2ab87f38f6f6e250b9a3 100644 (file)
@@ -234,6 +234,11 @@ struct ShutdownContext
    * Closure for cb
    */
   void *cb_cls;
+
+  /**
+   * Should we delete all of the files from the peers?
+   */
+  int delete_files;
 };
 
 /**
@@ -6711,7 +6716,7 @@ schedule_shutdown_task(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
       GNUNET_TESTING_daemon_stop (peer_shutdown_ctx->daemon,
                                   shutdown_ctx->timeout,
                                   &internal_shutdown_callback, peer_shutdown_ctx,
-                                  GNUNET_YES, GNUNET_NO);
+                                  shutdown_ctx->delete_files, GNUNET_NO);
     }
   else
     GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
@@ -6745,6 +6750,9 @@ GNUNET_TESTING_daemons_stop(struct GNUNET_TESTING_PeerGroup *pg,
   GNUNET_assert (pg->total > 0);
 
   shutdown_ctx = GNUNET_malloc (sizeof (struct ShutdownContext));
+  shutdown_ctx->delete_files = GNUNET_CONFIGURATION_get_value_yesno (pg->cfg,
+                                                                    "TESTING",
+                                                                    "DELETE_FILES");
   shutdown_ctx->cb = cb;
   shutdown_ctx->cb_cls = cb_cls;
   shutdown_ctx->total_peers = pg->total;