Submitter | Yuya Nishihara |
---|---|
Date | Aug. 14, 2016, 9:29 a.m. |
Message ID | <20ffcea3fc24f0ef534c.1471166966@mimosa> |
Download | mbox | patch |
Permalink | /patch/16274/ |
State | Accepted |
Headers | show |
Comments
Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara <yuya@tcha.org> > # Date 1471161693 -32400 > # Sun Aug 14 17:01:33 2016 +0900 > # Node ID 20ffcea3fc24f0ef534cd117bbbee134a8dc929c > # Parent 4faac945fa5a66924ffb8e35f8c0a812ec2ec535 > test-gpg: start gpg-agent under control of the test runner > > GnuPG v2 automatically starts gpg-agent. We should kill the daemon process. > > diff --git a/tests/test-gpg.t b/tests/test-gpg.t > --- a/tests/test-gpg.t > +++ b/tests/test-gpg.t > @@ -12,6 +12,13 @@ Test the GPG extension > $ GNUPGHOME="$TESTTMP/gpg"; export GNUPGHOME > $ cp -R "$TESTDIR/gpg" "$GNUPGHOME" > > +Start gpg-agent, which is required by GnuPG v2 > + > +#if gpg2 > + $ gpg-connect-agent -q --subst /serverpid '/echo ${get serverpid}' /bye \ > + > >> $DAEMON_PIDS > +#endif > + I got an error here: --- test-gpg.t 2016-08-26 20:00:15.146215645 -0700 +++ test-gpg.t.err 2016-08-26 20:06:43.142508667 -0700 @@ -17,6 +17,8 @@ #if gpg2 $ gpg-connect-agent -q --subst /serverpid '/echo ${get serverpid}' /bye \ > >> $DAEMON_PIDS + gpg-connect-agent: can't connect to the agent: IPC connect call failed + [1] $ gpg --no-permission-warning --no-secmem-warning --list-secret-keys \ > > /dev/null 2>&1 #endif which seems reasonable, since gpg-agent hasn't actually been started yet. The command -- gpg-connect-agent -- seems out of place with the comment, which talks about gpg-agent. What's actually supposed to happen? Is gpg supposed to start gpg-agent in the background? If so, then shouldn't using gpg-connect-agent to get the agent's pid come after that? Either way, I don't have gpg-agent running. So shouldn't gpg-connect-agent have a "2> /dev/null || true" or some such after it? Thanks, Danek
On Sat, 27 Aug 2016 14:17:28 -0700, Danek Duvall wrote: > Yuya Nishihara wrote: > > # HG changeset patch > > # User Yuya Nishihara <yuya@tcha.org> > > # Date 1471161693 -32400 > > # Sun Aug 14 17:01:33 2016 +0900 > > # Node ID 20ffcea3fc24f0ef534cd117bbbee134a8dc929c > > # Parent 4faac945fa5a66924ffb8e35f8c0a812ec2ec535 > > test-gpg: start gpg-agent under control of the test runner > > > > GnuPG v2 automatically starts gpg-agent. We should kill the daemon process. > > > > diff --git a/tests/test-gpg.t b/tests/test-gpg.t > > --- a/tests/test-gpg.t > > +++ b/tests/test-gpg.t > > @@ -12,6 +12,13 @@ Test the GPG extension > > $ GNUPGHOME="$TESTTMP/gpg"; export GNUPGHOME > > $ cp -R "$TESTDIR/gpg" "$GNUPGHOME" > > > > +Start gpg-agent, which is required by GnuPG v2 > > + > > +#if gpg2 > > + $ gpg-connect-agent -q --subst /serverpid '/echo ${get serverpid}' /bye \ > > + > >> $DAEMON_PIDS > > +#endif > > + > > I got an error here: > > --- test-gpg.t 2016-08-26 20:00:15.146215645 -0700 > +++ test-gpg.t.err 2016-08-26 20:06:43.142508667 -0700 > @@ -17,6 +17,8 @@ > #if gpg2 > $ gpg-connect-agent -q --subst /serverpid '/echo ${get serverpid}' /bye \ > > >> $DAEMON_PIDS > + gpg-connect-agent: can't connect to the agent: IPC connect call failed > + [1] > $ gpg --no-permission-warning --no-secmem-warning --list-secret-keys \ > > > /dev/null 2>&1 > #endif Can you provide "gpg --version" ? > which seems reasonable, since gpg-agent hasn't actually been started yet. > The command -- gpg-connect-agent -- seems out of place with the comment, > which talks about gpg-agent. > > What's actually supposed to happen? Is gpg supposed to start gpg-agent in > the background? If so, then shouldn't using gpg-connect-agent to get the > agent's pid come after that? The man page says gpg-connect-agent starts gpg-agent. What I want is to spawn gpg-agent and wait to get pid. https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html > Either way, I don't have gpg-agent running. So shouldn't gpg-connect-agent > have a "2> /dev/null || true" or some such after it? If no gpg-agent is running, "gpg --sign" of GnuPGv2 automatically starts it. AFAIK, gpg 2 can't run without agent.
Yuya Nishihara wrote: > > I got an error here: > > > > --- test-gpg.t 2016-08-26 20:00:15.146215645 -0700 > > +++ test-gpg.t.err 2016-08-26 20:06:43.142508667 -0700 > > @@ -17,6 +17,8 @@ > > #if gpg2 > > $ gpg-connect-agent -q --subst /serverpid '/echo ${get serverpid}' /bye \ > > > >> $DAEMON_PIDS > > + gpg-connect-agent: can't connect to the agent: IPC connect call failed > > + [1] > > $ gpg --no-permission-warning --no-secmem-warning --list-secret-keys \ > > > > /dev/null 2>&1 > > #endif > > Can you provide "gpg --version" ? gpg (GnuPG) 2.0.30 libgcrypt 1.7.2 Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Home: ~/.gnupg Supported algorithms: Pubkey: RSA, RSA, RSA, ELG, DSA Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH, CAMELLIA128, CAMELLIA192, CAMELLIA256 Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224 Compression: Uncompressed, ZIP, ZLIB, BZIP2 > > which seems reasonable, since gpg-agent hasn't actually been started yet. > > The command -- gpg-connect-agent -- seems out of place with the comment, > > which talks about gpg-agent. > > > > What's actually supposed to happen? Is gpg supposed to start gpg-agent in > > the background? If so, then shouldn't using gpg-connect-agent to get the > > agent's pid come after that? > > The man page says gpg-connect-agent starts gpg-agent. What I want is to spawn > gpg-agent and wait to get pid. > > https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html Neither the info page nor the man page on my system say that. Looks like this is a feature that's new with 2.1? I can probably try to get us upgraded to 2.1, but the fact that 2.0.x is labeled "stable" and continues to get updates probably doesn't help any. I can patch my local copy if you don't want to support gpg 2.0. Thanks, Danek
Patch
diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -349,6 +349,10 @@ def has_tla(): def has_gpg(): return matchoutput('gpg --version 2>&1', br'GnuPG') +@check("gpg2", "gpg client v2") +def has_gpg2(): + return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.') + @check("unix-permissions", "unix-style permissions") def has_unix_permissions(): d = tempfile.mkdtemp(dir='.', prefix=tempprefix) diff --git a/tests/test-gpg.t b/tests/test-gpg.t --- a/tests/test-gpg.t +++ b/tests/test-gpg.t @@ -12,6 +12,13 @@ Test the GPG extension $ GNUPGHOME="$TESTTMP/gpg"; export GNUPGHOME $ cp -R "$TESTDIR/gpg" "$GNUPGHOME" +Start gpg-agent, which is required by GnuPG v2 + +#if gpg2 + $ gpg-connect-agent -q --subst /serverpid '/echo ${get serverpid}' /bye \ + > >> $DAEMON_PIDS +#endif + $ hg init r $ cd r $ echo foo > foo