From: Tomi Ollila <tomi.ollila@iki.fi>
To: notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: [PATCH 2/2] exit lingering gpg agents at the end of relevant tests
Date: Tue, 23 May 2017 21:54:25 +0300 [thread overview]
Message-ID: <20170523185425.31470-3-tomi.ollila@iki.fi> (raw)
In-Reply-To: <20170523185425.31470-1-tomi.ollila@iki.fi>
Since gnupg 2.1.20, gpg-agent no longer shut itself down when
$GNUPGHOME directory is removed.
Add exit hooks to the test modules which execute `gpgconf --kill all`
Add exit hooks to execute `gpgconf --kill all` in the modules that
create $GNUPGHOME for gpg to work with.
---
test/T350-crypto.sh | 2 ++
test/T355-smime.sh | 2 ++
2 files changed, 4 insertions(+)
diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh
index b7d3a2c..d21cad1 100755
--- a/test/T350-crypto.sh
+++ b/test/T350-crypto.sh
@@ -11,6 +11,8 @@ add_gnupg_home ()
{
local output
[ -d ${GNUPGHOME} ] && return
+ _gnupg_exit () { gpgconf --kill all 2>/dev/null || true; }
+ at_exit_function _gnupg_exit
mkdir -m 0700 "$GNUPGHOME"
gpg --no-tty --import <$TEST_DIRECTORY/gnupg-secret-key.asc >"$GNUPGHOME"/import.log 2>&1
test_debug "cat $GNUPGHOME/import.log"
diff --git a/test/T355-smime.sh b/test/T355-smime.sh
index 639ca69..0f39bc6 100755
--- a/test/T355-smime.sh
+++ b/test/T355-smime.sh
@@ -7,6 +7,8 @@ add_gpgsm_home ()
{
local fpr
[ -d ${GNUPGHOME} ] && return
+ _gnupg_exit () { gpgconf --kill all 2>/dev/null || true; }
+ at_exit_function _gnupg_exit
mkdir -m 0700 "$GNUPGHOME"
gpgsm --no-tty --no-common-certs-import --disable-dirmngr --import < $TEST_DIRECTORY/smime/test.crt >"$GNUPGHOME"/import.log 2>&1
fpr=$(gpgsm --list-key test_suite@notmuchmail.org | sed -n 's/.*fingerprint: //p')
--
2.9.3
next prev parent reply other threads:[~2017-05-23 19:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-23 18:54 Tomi Ollila
2017-05-23 18:54 ` [PATCH 1/2] test-lib.sh: add "atexit" functionality Tomi Ollila
2017-05-23 18:54 ` Tomi Ollila [this message]
2017-05-23 21:19 ` [PATCH 2/2] exit lingering gpg agents at the end of relevant tests Daniel Kahn Gillmor
2017-05-24 17:17 ` David Bremner
2017-05-25 12:05 ` David Bremner
2017-05-26 10:40 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170523185425.31470-3-tomi.ollila@iki.fi \
--to=tomi.ollila@iki.fi \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).