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
|
tmpgpg_home=${test_tmpdir}/tmpgpghome
|
||||||
mkdir -m700 ${tmpgpg_home}
|
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
|
# Create an temporary trusted GPG directory
|
||||||
tmpgpg_trusted=${test_tmpdir}/tmpgpgtrusted
|
tmpgpg_trusted=${test_tmpdir}/tmpgpgtrusted
|
||||||
tmpgpg_trusted_keyring=${tmpgpg_trusted}/keyring.gpg
|
tmpgpg_trusted_keyring=${tmpgpg_trusted}/keyring.gpg
|
||||||
|
|
@ -301,5 +307,3 @@ if [ -f ${key1_rev} ]; then
|
||||||
else
|
else
|
||||||
echo "ok # SKIP could not find key revocation certificate"
|
echo "ok # SKIP could not find key revocation certificate"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
libtest_cleanup_gpg ${tmpgpg_home}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue