fix testcase cleanup in hostlist tests
authorChristian Grothoff <christian@grothoff.org>
Thu, 10 May 2018 11:47:27 +0000 (13:47 +0200)
committerChristian Grothoff <christian@grothoff.org>
Thu, 10 May 2018 11:47:27 +0000 (13:47 +0200)
src/hostlist/test_gnunet_daemon_hostlist.c
src/hostlist/test_gnunet_daemon_hostlist_learning.c
src/hostlist/test_gnunet_daemon_hostlist_reconnect.c

index eb4a851151333d91819ad88f30d502e91b6d9a61..dcdabaf6be8d1dcd72ef12e9396411e9045879d3 100644 (file)
@@ -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;
 }
 
index 88ad22a1ab29b5aa7bdef344302c037e760201bf..799ffc3ffae781dd504ce3e13dca8313e45154d4 100644 (file)
@@ -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"))
   {
index 2ebc780a7ebe2db57aea4ae9c171c7c2c56b663c..2ab55b6681ea3b3cc1358ce242ae82f542fc10e8 100644 (file)
@@ -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;
 }