From a126820b15d8402aaeae6189cdb9df469b690761 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 1 Aug 2018 14:37:13 -0700 Subject: tests: use "gpg2" instead of "gpg" command Some distro (notably debian and derived distros like ubuntu) still package the obsolete gpg 1.x series as "gpg", and provide the modern gpg 2.x tool as "gpg2". Other distros don't package gpg 1.x anymore, but most seem to provide a gpg2 symlink, so this should be safe for them. This is verified working on Archlinux, and is required to make these two tests work on Ubuntu 16.04 Xenial. --- tests/crypto_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/crypto_test.py b/tests/crypto_test.py index 56cc999d..334fcd56 100644 --- a/tests/crypto_test.py +++ b/tests/crypto_test.py @@ -1,4 +1,5 @@ # Copyright (C) 2017 Lucas Hoffmann +# Copyright © 2017-2018 Dylan Baker # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file import os @@ -125,7 +126,7 @@ class TestDetachedSignatureFor(unittest.TestCase): text = f.name self.addCleanup(os.unlink, f.name) - res = subprocess.check_call(['gpg', '--verify', sig, text], + res = subprocess.check_call(['gpg2', '--verify', sig, text], stdout=DEVNULL, stderr=DEVNULL) self.assertEqual(res, 0) @@ -376,7 +377,7 @@ class TestEncrypt(unittest.TestCase): self.addCleanup(os.unlink, enc_file) dec = subprocess.check_output( - ['gpg', '--decrypt', enc_file], stderr=DEVNULL) + ['gpg2', '--decrypt', enc_file], stderr=DEVNULL) self.assertEqual(to_encrypt, dec) -- cgit v1.2.3