aboutsummaryrefslogtreecommitdiff
path: root/src/statistics/test_gnunet_statistics.py.in
diff options
context:
space:
mode:
authorWillow Liquorice <willow@howhill.com>2022-08-29 22:01:18 +0100
committerWillow Liquorice <willow@howhill.com>2022-10-03 13:16:29 +0100
commit43b55e25e3824ea3bd9b4e10ee3dd2a5188b7f4c (patch)
tree8357efdb8fc09747562a1ae10d2f8e59f6a79623 /src/statistics/test_gnunet_statistics.py.in
parent4611664be0ba79ec7029a74cf961f28f2a658241 (diff)
downloadgnunet-43b55e25e3824ea3bd9b4e10ee3dd2a5188b7f4c.tar.gz
gnunet-43b55e25e3824ea3bd9b4e10ee3dd2a5188b7f4c.zip
-Removed references to explicit /tmp in test scripts and configurations in DHT, GNS, STATISTICS, and TRANSPORT subsystems.
Diffstat (limited to 'src/statistics/test_gnunet_statistics.py.in')
-rw-r--r--src/statistics/test_gnunet_statistics.py.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/statistics/test_gnunet_statistics.py.in b/src/statistics/test_gnunet_statistics.py.in
index ce277b13e..ad7e95bd1 100644
--- a/src/statistics/test_gnunet_statistics.py.in
+++ b/src/statistics/test_gnunet_statistics.py.in
@@ -7,6 +7,7 @@ import re
7import subprocess 7import subprocess
8import time 8import time
9 9
10raw_tmp = True
10if os.name == "nt": 11if os.name == "nt":
11 tmp = os.getenv("TEMP") 12 tmp = os.getenv("TEMP")
12elif None != os.environ.get("TMPDIR"): 13elif None != os.environ.get("TMPDIR"):
@@ -14,7 +15,9 @@ elif None != os.environ.get("TMPDIR"):
14elif None != os.environ.get("TMP"): 15elif None != os.environ.get("TMP"):
15 tmp = os.getenv("TMP") 16 tmp = os.getenv("TMP")
16else: 17else:
17 tmp = "/tmp" 18 raw_tmp = False
19 tmp = subprocess.check_output("gnunet-config -f -s PATHS -o GNUNET_TMP",
20 text=True)
18 21
19if os.name == 'nt': 22if os.name == 'nt':
20 st = './gnunet-statistics.exe' 23 st = './gnunet-statistics.exe'
@@ -30,8 +33,14 @@ if debug:
30 run_arm += [debug.split(' ')] 33 run_arm += [debug.split(' ')]
31 34
32 35
36if raw_tmp:
37 cleanup_path = "gnunet/test-gnunet-statistics"
38else:
39 cleanup_path = "test-gnunet-statistics"
40
41
33def cleanup(): 42def cleanup():
34 shutil.rmtree(os.path.join(tmp, "gnunet/test-gnunet-statistics"), True) 43 shutil.rmtree(os.path.join(tmp, cleanup_path), True)
35 44
36 45
37def sub_run(args, want_stdo=True, want_stde=False, nofail=False): 46def sub_run(args, want_stdo=True, want_stde=False, nofail=False):