# HG changeset patch # User Yuya Nishihara # Date 1471161693 -32400 # Node ID 94fb0458a7914fb718c24fb2ece47ea199ef941c # Parent 66e038fb3c0d74dc6bfde8f52ee912bf21d3ee11 test-gpg: start gpg-agent under control of the test runner GnuPG v2 automatically starts gpg-agent. We should kill the daemon process. diff -r 66e038fb3c0d -r 94fb0458a791 tests/hghave.py --- a/tests/hghave.py Sun Aug 14 16:49:47 2016 +0900 +++ b/tests/hghave.py Sun Aug 14 17:01:33 2016 +0900 @@ -349,6 +349,10 @@ 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 -r 66e038fb3c0d -r 94fb0458a791 tests/test-gpg.t --- a/tests/test-gpg.t Sun Aug 14 16:49:47 2016 +0900 +++ b/tests/test-gpg.t Sun Aug 14 17:01:33 2016 +0900 @@ -12,6 +12,13 @@ $ 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