Skip to content

Commit

Permalink
Merge pull request #4045 from freedomofpress/gpg-import-ok
Browse files Browse the repository at this point in the history
[xenial] resolve gpg IMPORT_OK status code test failures
  • Loading branch information
heartsucker authored Jan 18, 2019
2 parents e279856 + 09a63fc commit 54c7910
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion securedrop/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def config(tmpdir):
tmp = data.mkdir('tmp')
sqlite = data.join('db.sqlite')

gpg = gnupg.GPG(homedir=str(keys))
gpg = gnupg.GPG('gpg2', homedir=str(keys))
for ext in ['sec', 'pub']:
with io.open(path.join(path.dirname(__file__),
'files',
Expand Down
2 changes: 1 addition & 1 deletion securedrop/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def _can_decrypt_with_key(journalist_app, msg, key_fpr, passphrase=None):
# to use it to test whether a message is decryptable with a specific
# key.
gpg_tmp_dir = tempfile.mkdtemp()
gpg = gnupg.GPG(homedir=gpg_tmp_dir)
gpg = gnupg.GPG('gpg2', homedir=gpg_tmp_dir)

# Export the key of interest from the application's keyring
pubkey = journalist_app.crypto_util.gpg.export_keys(key_fpr)
Expand Down
2 changes: 1 addition & 1 deletion securedrop/tests/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def init_gpg():
"""Initialize the GPG keyring and import the journalist key for
testing.
"""
gpg = gnupg.GPG(homedir=config.GPG_KEY_DIR)
gpg = gnupg.GPG('gpg2', homedir=config.GPG_KEY_DIR)
# Faster to import a pre-generated key than to gen a new one every time.
for keyfile in (join(FILES_DIR, "test_journalist_key.pub"),
join(FILES_DIR, "test_journalist_key.sec")):
Expand Down

0 comments on commit 54c7910

Please sign in to comment.