Clear gpg-agent cache so bad psswds don't pass

This commit is contained in:
Stephen Seo 2023-10-06 15:54:03 +09:00
parent d11af2fd99
commit 6c0aa0abdd
1 changed files with 8 additions and 0 deletions

View File

@ -1616,6 +1616,14 @@ def test_gpg_passphrase(
tempnf.write(b"Test file content")
tempnf.flush()
try:
# Clear gpg password cache so that incorrect passwords don't pass.
subprocess.run(
("/usr/bin/env", "gpg-connect-agent", "reloadagent", "/bye"),
check=True,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
env={"GNUPGHOME": signing_gpg_dir},
)
subprocess.run(
(
"/usr/bin/env",