From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 8C3466DE091E for ; Tue, 23 May 2017 12:02:25 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.164 X-Spam-Level: X-Spam-Status: No, score=0.164 tagged_above=-999 required=5 tests=[AWL=0.173, HEADER_FROM_DIFFERENT_DOMAINS=0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x4I-FIJ3tI2w for ; Tue, 23 May 2017 12:02:25 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 8F0846DE0B14 for ; Tue, 23 May 2017 12:02:23 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id AE1371001FD; Tue, 23 May 2017 21:54:40 +0300 (EEST) From: Tomi Ollila 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 Message-Id: <20170523185425.31470-3-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170523185425.31470-1-tomi.ollila@iki.fi> References: <20170523185425.31470-1-tomi.ollila@iki.fi> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 May 2017 19:02:25 -0000 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