Re: [PATCH 2/2] exit lingering gpg agents at the end of relevant tests

2017-05-25 Thread David Bremner
David Bremner  writes:

> Tomi Ollila  writes:
>
>> 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`
>>
>
> Did you test this on some machines with old gpg (1.x)? I think I don't
> have easy access to such, although I could try in a chroot/container.
>

Which I did, and it seems to work fine with gpg 1.4.18 on debian stable
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 2/2] exit lingering gpg agents at the end of relevant tests

2017-05-24 Thread David Bremner
Tomi Ollila  writes:

> 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`
>

Did you test this on some machines with old gpg (1.x)? I think I don't
have easy access to such, although I could try in a chroot/container.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 2/2] exit lingering gpg agents at the end of relevant tests

2017-05-23 Thread Daniel Kahn Gillmor
On Tue 2017-05-23 21:54:25 +0300, Tomi Ollila wrote:
> 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.

this pair of patches LGTM.

 --dkg
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 2/2] exit lingering gpg agents at the end of relevant tests

2017-05-23 Thread Tomi Ollila
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_su...@notmuchmail.org | sed -n 
's/.*fingerprint: //p')
-- 
2.9.3

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch