From 4cb5b2c1d3783bfad3c4f77b2ad2ac89921e91f4 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 21 Jul 2020 16:03:32 +0200 Subject: [PATCH 4/6] Make invoking GnuPG more robust. GnuPG will try to read its state even for operations that do not require it, e.g. listing packets. If the state directory does not exist, GnuPG will try to create it. If this fails, GnuPG errors out. In some build environments, $HOME may not exist or may not be writable (e.g. in Guix and Nix, $HOME does not exist). This leads to a spurious test failures when GnuPG is invoked to inspect packets. Fix this by using the current directory as GnuPG state directory. Merged upstream as 681e3be65594469f2e6e5912b4371d1af981d7c7. --- src/tests/cli_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/cli_tests.py b/src/tests/cli_tests.py index 74b28983..2b7d772a 100755 --- a/src/tests/cli_tests.py +++ b/src/tests/cli_tests.py @@ -106,7 +106,8 @@ RNP_TO_GPG_CIPHERS = {'AES' : 'aes128', 'AES192' : 'aes192', 'AES256' : 'aes256' 'IDEA' : 'idea', '3DES' : '3des', 'CAST5' : 'cast5', 'BLOWFISH' : 'blowfish'} def check_packets(fname, regexp): - ret, output, err = run_proc(GPG, ['--list-packets', path_for_gpg(fname)]) + ret, output, err = run_proc(GPG, ['--homedir', '.', + '--list-packets', path_for_gpg(fname)]) if ret != 0: logging.error(err) return None -- 2.20.1