From 91d1bc4750c36d7f3e996f483fe4bee7c242eb45 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 25 Jul 2011 14:11:35 +0000 Subject: [PATCH] allow user to configure no deletion with testing --- contrib/defaults.conf | 3 +++ src/testing/testing_group.c | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/contrib/defaults.conf b/contrib/defaults.conf index 26d5d6237..86c6a25ed 100644 --- a/contrib/defaults.conf +++ b/contrib/defaults.conf @@ -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 diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index f2442aade..e7be22a8a 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c @@ -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; -- 2.25.1