From bb230d4d990db60513c1e8083b46c7b8e91489f5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 10 May 2018 13:47:27 +0200 Subject: [PATCH] fix testcase cleanup in hostlist tests --- src/hostlist/test_gnunet_daemon_hostlist.c | 18 ++++++++++++------ .../test_gnunet_daemon_hostlist_learning.c | 12 ++++++++---- .../test_gnunet_daemon_hostlist_reconnect.c | 18 ++++++++++++------ 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c index eb4a85115..dcdabaf6b 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist.c +++ b/src/hostlist/test_gnunet_daemon_hostlist.c @@ -265,16 +265,22 @@ main (int argc, char *argv[]) { int ret; - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer1.conf", + "GNUNET_TEST_HOME"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer2.conf", + "GNUNET_TEST_HOME"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_data.conf", + "GNUNET_TEST_HOME"); GNUNET_log_setup ("test-gnunet-daemon-hostlist", "WARNING", NULL); ret = check (); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer1.conf", + "GNUNET_TEST_HOME"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer2.conf", + "GNUNET_TEST_HOME"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_data.conf", + "GNUNET_TEST_HOME"); return ret; } diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index 88ad22a1a..799ffc3ff 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c @@ -562,14 +562,18 @@ main (int argc, char *argv[]) { int ret; - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); + GNUNET_DISK_purge_cfg_dir ("test_learning_learn_peer.conf", + "GNUNET_TEST_HOME"); + GNUNET_DISK_purge_cfg_dir ("test_learning_adv_peer.conf", + "GNUNET_TEST_HOME"); GNUNET_log_setup ("test-gnunet-daemon-hostlist", "WARNING", NULL); ret = check (); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); + GNUNET_DISK_purge_cfg_dir ("test_learning_learn_peer.conf", + "GNUNET_TEST_HOME"); + GNUNET_DISK_purge_cfg_dir ("test_learning_adv_peer.conf", + "GNUNET_TEST_HOME"); if (GNUNET_YES == GNUNET_DISK_file_test ("hostlists_learn_peer.file")) { diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c index 2ebc780a7..2ab55b668 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c @@ -242,9 +242,12 @@ main (int argcx, GNUNET_GETOPT_OPTION_END }; - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-3"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer1.conf", + "GNUNET_TEST_HOME"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer2.conf", + "GNUNET_TEST_HOME"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_data.conf", + "GNUNET_TEST_HOME"); GNUNET_log_setup ("test-gnunet-daemon-hostlist", "WARNING", NULL); @@ -272,9 +275,12 @@ main (int argcx, "%s", ".\n"); } - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); - GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-3"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer1.conf", + "GNUNET_TEST_HOME"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_peer2.conf", + "GNUNET_TEST_HOME"); + GNUNET_DISK_purge_cfg_dir ("test_gnunet_daemon_hostlist_data.conf", + "GNUNET_TEST_HOME"); return ok; } -- 2.25.1