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

View file

@ -1616,6 +1616,14 @@ def test_gpg_passphrase(
tempnf.write(b"Test file content") tempnf.write(b"Test file content")
tempnf.flush() tempnf.flush()
try: 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( subprocess.run(
( (
"/usr/bin/env", "/usr/bin/env",