1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| | From f544b3e63416f3a824ed2955d119ea0d36c88b36 Mon Sep 17 00:00:00 2001
From: Justus Winter <teythoon@avior.uberspace.de>
Date: Tue, 21 Jul 2020 16:00:37 +0200
Subject: [PATCH] Make test environment setup more robust.
Previously, a failing test leaving RNP or GnuPG state directories
behind would cause all tests following it to fail. Improve this by
removing the directories first should they exist.
---
src/tests/cli_tests.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/tests/cli_tests.py b/src/tests/cli_tests.py
index 2b7d772a..8261486f 100755
--- a/src/tests/cli_tests.py
+++ b/src/tests/cli_tests.py
@@ -704,12 +704,14 @@ def setup(loglvl):
RNPDIR = path.join(WORKDIR, '.rnp')
RNP = os.getenv('RNP_TESTS_RNP_PATH') or 'rnp'
RNPK = os.getenv('RNP_TESTS_RNPKEYS_PATH') or 'rnpkeys'
+ shutil.rmtree(RNPDIR, ignore_errors=True)
os.mkdir(RNPDIR, 0700)
GPGDIR = path.join(WORKDIR, '.gpg')
GPGHOME = path_for_gpg(GPGDIR) if is_windows() else GPGDIR
GPG = os.getenv('RNP_TESTS_GPG_PATH') or find_utility('gpg')
GPGCONF = os.getenv('RNP_TESTS_GPGCONF_PATH') or find_utility('gpgconf')
+ shutil.rmtree(GPGDIR, ignore_errors=True)
os.mkdir(GPGDIR, 0700)
def data_path(subpath):
--
2.20.1
|