summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-04-10 22:35:44 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-04-11 13:02:29 -0400
commit2a9c41ef4b6df68fc5caa030a9f0641468914439 (patch)
treefce6ab23176f6c4d677f7fceed5e54040fb46f89 /test
parentb03e91d645bcd0d664e53967857154a2c2be082a (diff)
test/test-common.sh: Ensure that an old gpg-agent isn't running.
It is possible that the gpg has been updated since the user's gpg-agent was started; this will cause mysterious errors, as they will detect the version mismatch. If the user isn't running a gpg-agent, then one will be started. However, it will persist longer than useful, and it will be left looking at a .gnupg directory that no longer exists. It's just not worth the trouble to let an existing agent keep running.
Diffstat (limited to 'test')
-rw-r--r--test/test-common.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test-common.sh b/test/test-common.sh
index 2cbbe56..244e3b7 100644
--- a/test/test-common.sh
+++ b/test/test-common.sh
@@ -18,14 +18,19 @@ before() {
unset BUILDDIR
unset PKGEXT SRCEXT
unset GPGKEY PACKAGER
+ killall gpg-agent &>/dev/null || true
+
tmpdir="$(mktemp -d --tmpdir "test-${roundup_desc//\//-}.${roundup_test_name}.XXXXXXXXXXXX")"
chmod 755 "$tmpdir"
+
stat=0
+
common_before
}
after() {
common_after
+ killall gpg-agent &>/dev/null || true
if [[ -f "$tmpdir/.used-sudo" ]]; then
sudo rm -rf -- "$tmpdir" "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME"
else