mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-09 01:18:35 +03:00
tests/gpg: Use exit hook to kill agent in temporary GPG homedir
This wasn't available when I originally wrote this, but it ensures that the running gpg-agent in tmpgpghome is killed in case the tests exit early. Closes: #1892 Approved by: jlebon
This commit is contained in:
parent
615861443b
commit
8ac348d19a
@ -100,6 +100,12 @@ fi
|
||||
tmpgpg_home=${test_tmpdir}/tmpgpghome
|
||||
mkdir -m700 ${tmpgpg_home}
|
||||
|
||||
# Wire up an exit hook to kill the gpg-agent in it
|
||||
cleanup_tmpgpg_home() {
|
||||
libtest_cleanup_gpg ${tmpgpg_home}
|
||||
}
|
||||
libtest_exit_cmds+=(cleanup_tmpgpg_home)
|
||||
|
||||
# Create an temporary trusted GPG directory
|
||||
tmpgpg_trusted=${test_tmpdir}/tmpgpgtrusted
|
||||
tmpgpg_trusted_keyring=${tmpgpg_trusted}/keyring.gpg
|
||||
@ -301,5 +307,3 @@ if [ -f ${key1_rev} ]; then
|
||||
else
|
||||
echo "ok # SKIP could not find key revocation certificate"
|
||||
fi
|
||||
|
||||
libtest_cleanup_gpg ${tmpgpg_home}
|
||||
|
Loading…
Reference in New Issue
Block a user