git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Santiago Torres <santiago@nyu.edu>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: Re: [PATCH] t: lib-gpg: flush gpg agent on startup
Date: Thu, 20 Jul 2017 13:01:14 -0400	[thread overview]
Message-ID: <20170720170113.fvquowatpv4ms6if@LykOS.localdomain> (raw)
In-Reply-To: <20170720165814.30037-1-santiago@nyu.edu>

[-- Attachment #1: Type: text/plain, Size: 1753 bytes --]

This is the patch that stemmed from [1].

I tried to keep it simple and not noisy, alhtough it breaks the &&
chain, it needs to be run right before the --import command. I also
decided to drop the switch chain in case that regression was to be
introduced in the future in other versions (hopefully gpgconf goes
nowhere by then).

I was able to test this on debian oldstable/stable and arch.

Cheers!
-Santiago.

[1] https://public-inbox.org/git/xmqqvampmnmv.fsf@gitster.mtv.corp.google.com/

On Thu, Jul 20, 2017 at 12:58:14PM -0400, santiago@nyu.edu wrote:
> From: Santiago Torres <santiago@nyu.edu>
> 
> When running gpg-relevant tests, a gpg-daemon is spawned for each
> GNUPGHOME used. This daemon may stay running after the test and cache
> file descriptors for the trash directories, even after the trash
> directory is removed. This leads to ENOENT errors when attempting to
> create files if tests are run multiple times.
> 
> Add a cleanup script to force flushing the gpg-agent for that GNUPGHOME
> (if any) before setting up the GPG relevant-environment.
> 
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Santiago Torres <santiago@nyu.edu>
> ---
>  t/lib-gpg.sh | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
> index ec2aa8f68..7a6c7ee6f 100755
> --- a/t/lib-gpg.sh
> +++ b/t/lib-gpg.sh
> @@ -31,6 +31,7 @@ then
>  		chmod 0700 ./gpghome &&
>  		GNUPGHOME="$(pwd)/gpghome" &&
>  		export GNUPGHOME &&
> +		gpgconf --kill gpg-agent 2>&1 >/dev/null
>  		gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \
>  			"$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
>  		gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \
> -- 
> 2.13.3
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-07-20 17:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 16:58 [PATCH] t: lib-gpg: flush gpg agent on startup santiago
2017-07-20 17:01 ` Santiago Torres [this message]
2017-07-20 20:00   ` Junio C Hamano
2017-07-20 20:25     ` Santiago Torres

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: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170720170113.fvquowatpv4ms6if@LykOS.localdomain \
    --to=santiago@nyu.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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://80x24.org/mirrors/git.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).