summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillow Liquorice <willow@howhill.com>2022-05-29 16:40:28 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2022-08-21 08:16:29 +0200
commitb26506fd640df98b3bfd70eff230754a1fdee104 (patch)
tree1979e4fb7ac0fed79a444db78d264b77e8a0f4ea
parent12bd374fa9456bedfedf2a0e3a77d284b7f80cec (diff)
-Replaced several hardcoded /tmp locations in tests of CORE, FS, IDENTITY, NAMECHACHE, PT, TOPOLOGY, and TESTBED subsystemsdev/willow/gnunet_temp
-rw-r--r--src/core/test_core_api.c8
-rw-r--r--src/core/test_core_api_reliability.c6
-rw-r--r--src/core/test_core_api_send_to_self.conf2
-rw-r--r--src/core/test_core_api_start_only.c18
-rw-r--r--src/core/test_core_quota_compliance.c28
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p.c4
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p_respect.c3
-rw-r--r--src/fs/test_fs_test_lib.c6
-rw-r--r--src/fs/test_fs_uri.c5
-rw-r--r--src/fs/test_gnunet_service_fs_migration.c4
-rw-r--r--src/fs/test_gnunet_service_fs_p2p.c3
-rw-r--r--src/identity/test_identity.c6
-rw-r--r--src/identity/test_identity_defaults.c6
-rw-r--r--src/namecache/test_namecache_api_cache_block.c4
-rw-r--r--src/namecache/test_plugin_namecache.c13
-rw-r--r--src/pt/test_gns_vpn.c3
-rw-r--r--src/pt/test_gnunet_vpn.c3
-rw-r--r--src/testbed-logger/test_testbed_logger_api.c8
-rw-r--r--src/topology/test_gnunet_daemon_topology.c4
19 files changed, 92 insertions, 42 deletions
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index 064964292..653ce1aa0 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -334,8 +334,12 @@ main (int argc, char *argv1[])
&ok);
stop_arm (&p1);
stop_arm (&p2);
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1");
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_api_peer1.conf",
+ "GNUNET_TEST_HOME");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_api_peer2.conf",
+ "GNUNET_TEST_HOME");
return ok;
}
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c
index debf808ca..d4b55a6b8 100644
--- a/src/core/test_core_api_reliability.c
+++ b/src/core/test_core_api_reliability.c
@@ -525,8 +525,10 @@ main (int argc,
stop_arm (&p2);
GNUNET_free (p1.hello);
GNUNET_free (p2.hello);
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1");
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2");
+ GNUNET_DISK_purge_cfg_dir ("test_core_api_peer1.conf",
+ "GNUNET_TEST_HOME");
+ GNUNET_DISK_purge_cfg_dir ("test_core_api_peer2.conf",
+ "GNUNET_TEST_HOME");
return ok;
}
diff --git a/src/core/test_core_api_send_to_self.conf b/src/core/test_core_api_send_to_self.conf
index c2a459bb9..fe8e69999 100644
--- a/src/core/test_core_api_send_to_self.conf
+++ b/src/core/test_core_api_send_to_self.conf
@@ -1,6 +1,6 @@
@INLINE@ test_core_defaults.conf
[PATHS]
-GNUNET_TEST_HOME = ~/.gnunet/
+GNUNET_TEST_HOME = $GNUNET_TMP/test-core-api-send-to-self/
[ats]
WAN_QUOTA_IN = 104857600
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c
index 007131134..e50d3b2ec 100644
--- a/src/core/test_core_api_start_only.c
+++ b/src/core/test_core_api_start_only.c
@@ -211,9 +211,13 @@ check ()
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
-
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1");
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2");
+
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_api_peer1.conf",
+ "GNUNET_TEST_HOME");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_api_peer2.conf",
+ "GNUNET_TEST_HOME");
ok = 1;
GNUNET_PROGRAM_run ((sizeof(argv) / sizeof(char *)) - 1,
@@ -241,8 +245,12 @@ main (int argc,
"WARNING",
NULL);
ret = check ();
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1");
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_api_peer1.conf",
+ "GNUNET_TEST_HOME");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_api_peer2.conf",
+ "GNUNET_TEST_HOME");
return ret;
}
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index cf2da3d97..eb5ca7c2b 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -722,22 +722,30 @@ cleanup_directory (int test)
switch (test)
{
case SYMMETRIC:
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-quota-sym-peer-1/");
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-quota-sym-peer-2/");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_quota_peer1.conf",
+ "GNUNET_TEST_HOME");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_quota_peer2.conf",
+ "GNUNET_TEST_HOME");
break;
case ASYMMETRIC_SEND_LIMITED:
- GNUNET_DISK_directory_remove
- ("/tmp/test-gnunet-core-quota-asym-send-lim-peer-1/");
- GNUNET_DISK_directory_remove
- ("/tmp/test-gnunet-core-quota-asym-send-lim-peer-2/");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_quota_asymmetric_send_limit_peer1.conf",
+ "GNUNET_TEST_HOME");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_quota_asymmetric_send_limit_peer2.conf",
+ "GNUNET_TEST_HOME");
break;
case ASYMMETRIC_RECV_LIMITED:
- GNUNET_DISK_directory_remove
- ("/tmp/test-gnunet-core-quota-asym-recv-lim-peer-1/");
- GNUNET_DISK_directory_remove
- ("/tmp/test-gnunet-core-quota-asym-recv-lim-peer-2/");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_quota_asymmetric_recv_limited_peer1.conf",
+ "GNUNET_TEST_HOME");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_core_quota_asymmetric_recv_limited_peer2.conf",
+ "GNUNET_TEST_HOME");
break;
}
}
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c
index 062f062b5..2c7830f5f 100644
--- a/src/fs/perf_gnunet_service_fs_p2p.c
+++ b/src/fs/perf_gnunet_service_fs_p2p.c
@@ -360,7 +360,9 @@ main (int argc, char *argv[])
NUM_DAEMONS,
0, NULL, NULL,
&do_publish, NULL);
- GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
+ GNUNET_DISK_purge_cfg_dir
+ ("perf_gnunet_service_fs_p2p.conf",
+ "GNUNET_TEST_HOME");
return ok;
}
diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c
index c48db2383..6b71b1f93 100644
--- a/src/fs/perf_gnunet_service_fs_p2p_respect.c
+++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c
@@ -471,7 +471,8 @@ main (int argc, char *argv[])
NUM_DAEMONS,
0, NULL, NULL,
&do_connect, NULL);
- GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
+ GNUNET_DISK_purge_cfg_dir ("perf_gnunet_service_fs_p2p.conf",
+ "GNUNET_TEST_HOME");
return ok;
}
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c
index 7f0077bdd..714dd452e 100644
--- a/src/fs/test_fs_test_lib.c
+++ b/src/fs/test_fs_test_lib.c
@@ -165,13 +165,15 @@ run (void *cls,
int
main (int argc, char *argv[])
{
- GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
+ GNUNET_DISK_purge_cfg_dir ("fs_test_lib_data.conf",
+ "GNUNET_TEST_HOME");
(void) GNUNET_TESTBED_test_run ("test_fs_test_lib",
"fs_test_lib_data.conf",
NUM_DAEMONS,
0, NULL, NULL,
&run, NULL);
- GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
+ GNUNET_DISK_purge_cfg_dir ("fs_test_lib_data.conf",
+ "GNUNET_TEST_HOME");
return ret;
}
diff --git a/src/fs/test_fs_uri.c b/src/fs/test_fs_uri.c
index aac7b1b97..e0f23097b 100644
--- a/src/fs/test_fs_uri.c
+++ b/src/fs/test_fs_uri.c
@@ -327,7 +327,10 @@ main (int argc, char *argv[])
failureCount += testFile (i);
}
/* fprintf (stderr, "%s", "\n"); */
- GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-uri");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_fs_uri.conf",
+ "GNUNET_TEST_HOME");
+
if (failureCount != 0)
return 1;
return 0;
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c
index d4a1c38b5..38b00f3e8 100644
--- a/src/fs/test_gnunet_service_fs_migration.c
+++ b/src/fs/test_gnunet_service_fs_migration.c
@@ -213,7 +213,9 @@ main (int argc,
0, NULL, NULL,
&do_publish,
NULL);
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-service-fs-migration/");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_gnunet_service_fs_migration_data.conf",
+ "GNUNET_TEST_HOME");
return ok;
}
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c
index bedcb7173..2d1fbb788 100644
--- a/src/fs/test_gnunet_service_fs_p2p.c
+++ b/src/fs/test_gnunet_service_fs_p2p.c
@@ -158,7 +158,8 @@ main (int argc, char *argv[])
NUM_DAEMONS,
0, NULL, NULL,
&do_publish, NULL);
- GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
+ GNUNET_DISK_purge_cfg_dir (config,
+ "GNUNET_TEST_HOME");
return ok;
}
diff --git a/src/identity/test_identity.c b/src/identity/test_identity.c
index 4954fe7be..58c2c8d9e 100644
--- a/src/identity/test_identity.c
+++ b/src/identity/test_identity.c
@@ -290,7 +290,8 @@ run (void *cls,
int
main (int argc, char *argv[])
{
- GNUNET_DISK_directory_remove ("/tmp/gnunet/test-identity-service");
+ GNUNET_DISK_purge_cfg_dir ("test_identity.conf",
+ "GNUNET_TEST_HOME");
res = 1;
if (0 != GNUNET_TESTING_service_run ("test-identity",
"identity",
@@ -298,7 +299,8 @@ main (int argc, char *argv[])
&run,
NULL))
return 1;
- GNUNET_DISK_directory_remove ("/tmp/gnunet/test-identity-service");
+ GNUNET_DISK_purge_cfg_dir ("test_identity.conf",
+ "GNUNET_TEST_HOME");
return res;
}
diff --git a/src/identity/test_identity_defaults.c b/src/identity/test_identity_defaults.c
index 2d5244d1b..63db58a1a 100644
--- a/src/identity/test_identity_defaults.c
+++ b/src/identity/test_identity_defaults.c
@@ -277,7 +277,8 @@ run_set (void *cls,
int
main (int argc, char *argv[])
{
- GNUNET_DISK_directory_remove ("/tmp/gnunet/test-identity-service");
+ GNUNET_DISK_purge_cfg_dir ("test_identity.conf",
+ "GNUNET_TEST_HOME");
res = 1;
if (0 != GNUNET_TESTING_service_run ("test-identity-defaults",
"identity",
@@ -291,7 +292,8 @@ main (int argc, char *argv[])
&run_get,
NULL))
return 1;
- GNUNET_DISK_directory_remove ("/tmp/gnunet/test-identity-service");
+ GNUNET_DISK_purge_cfg_dir ("test_identity.conf",
+ "GNUNET_TEST_HOME");
return res;
}
diff --git a/src/namecache/test_namecache_api_cache_block.c b/src/namecache/test_namecache_api_cache_block.c
index 6188fb014..2e8940ba3 100644
--- a/src/namecache/test_namecache_api_cache_block.c
+++ b/src/namecache/test_namecache_api_cache_block.c
@@ -227,7 +227,9 @@ run (void *cls,
int
main (int argc, char *argv[])
{
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-namecache/");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_namecache_api.conf",
+ "GNUNET_TEST_HOME");
res = 1;
if (0 !=
GNUNET_TESTING_service_run ("test-namecache-api",
diff --git a/src/namecache/test_plugin_namecache.c b/src/namecache/test_plugin_namecache.c
index f3cb46c02..242b3503b 100644
--- a/src/namecache/test_plugin_namecache.c
+++ b/src/namecache/test_plugin_namecache.c
@@ -113,18 +113,21 @@ main (int argc, char *argv[])
GNUNET_GETOPT_OPTION_END
};
- GNUNET_DISK_directory_remove ("/tmp/gnunet-test-plugin-namecache-sqlite");
- GNUNET_log_setup ("test-plugin-namecache",
- "WARNING",
- NULL);
plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (cfg_name, sizeof(cfg_name), "test_plugin_namecache_%s.conf",
plugin_name);
+
+ GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME");
+
+ GNUNET_log_setup ("test-plugin-namecache",
+ "WARNING",
+ NULL);
GNUNET_PROGRAM_run ((sizeof(xargv) / sizeof(char *)) - 1, xargv,
"test-plugin-namecache", "nohelp", options, &run, NULL);
+
if (ok != 0)
fprintf (stderr, "Missed some testcases: %d\n", ok);
- GNUNET_DISK_directory_remove ("/tmp/gnunet-test-plugin-namecache-sqlite");
+ GNUNET_DISK_purge_cfg_dir (cfg_name, "GNUNET_TEST_HOME");
return ok;
}
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c
index d2d28d7c7..d4da622c6 100644
--- a/src/pt/test_gns_vpn.c
+++ b/src/pt/test_gns_vpn.c
@@ -857,7 +857,8 @@ main (int argc,
&run,
NULL))
return 1;
- GNUNET_DISK_directory_remove ("/tmp/gnunet-test-vpn");
+ GNUNET_DISK_purge_cfg_dir ("test_gns_vpn.conf",
+ "GNUNET_TEST_HOME");
return global_ret;
}
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c
index ab197b60d..9552b12a9 100644
--- a/src/pt/test_gnunet_vpn.c
+++ b/src/pt/test_gnunet_vpn.c
@@ -511,7 +511,8 @@ main (int argc, char *const *argv)
GNUNET_TESTING_peer_run ("test-gnunet-vpn", "test_gnunet_vpn.conf", &run,
NULL))
return 1;
- GNUNET_DISK_directory_remove ("/tmp/gnunet-test-vpn");
+ GNUNET_DISK_purge_cfg_dir ("test_gnunet_vpn.conf",
+ "GNUNET_TEST_HOME");
return global_ret;
}
diff --git a/src/testbed-logger/test_testbed_logger_api.c b/src/testbed-logger/test_testbed_logger_api.c
index 085f83d0e..46271c398 100644
--- a/src/testbed-logger/test_testbed_logger_api.c
+++ b/src/testbed-logger/test_testbed_logger_api.c
@@ -259,14 +259,18 @@ main (int argc, char **argv)
"WARNING",
NULL);
GNUNET_break (GNUNET_OK ==
- GNUNET_DISK_directory_remove ("/tmp/test-testbed"));
+ GNUNET_DISK_purge_cfg_dir
+ ("test_testbed_logger_api.conf",
+ "GNUNET_TEST_HOME"));
ret = GNUNET_TESTING_service_run ("test-testbed-logger",
"testbed-logger",
"test_testbed_logger_api.conf",
&test_main,
NULL);
GNUNET_break (GNUNET_OK ==
- GNUNET_DISK_directory_remove ("/tmp/test-testbed"));
+ GNUNET_DISK_purge_cfg_dir
+ ("test_testbed_logger_api.conf",
+ "GNUNET_TEST_HOME"));
if (0 != ret)
return 1;
if (GNUNET_OK != result)
diff --git a/src/topology/test_gnunet_daemon_topology.c b/src/topology/test_gnunet_daemon_topology.c
index d1081515c..6f9758b09 100644
--- a/src/topology/test_gnunet_daemon_topology.c
+++ b/src/topology/test_gnunet_daemon_topology.c
@@ -289,7 +289,9 @@ main (int argc, char *argv[])
NUM_PEERS,
0, NULL, NULL,
&do_connect, NULL);
- GNUNET_DISK_directory_remove ("/tmp/test-gnunet-topology");
+ GNUNET_DISK_purge_cfg_dir
+ ("test_gnunet_daemon_topology_data.conf",
+ "GNUNET_TEST_HOME");
return (GNUNET_OK != result) ? 1 : 0;
}