GNU bug report logs - #23561
epg tests are (almost) always skipped

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Tue, 17 May 2016 06:30:02 UTC

Severity: minor

Tags: confirmed

Found in version 25.0.93

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23561 in the body.
You can then email your comments to 23561 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Tue, 17 May 2016 06:30:02 GMT) Full text and rfc822 format available.

Message #3 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: submit <at> debbugs.gnu.org
Subject: epg tests are (almost) always skipped
Date: Tue, 17 May 2016 02:29:06 -0400
Package: emacs
Version: 25.0.93

Since f93d669a, epg-gpg-program defaults to gpg2 if present (which it is
on most systems, I guess). epg-tests-gpg-usable, however, requires gpg
version 1 (in the 'require-passphrase case, which is what every test in
epg-tests uses). As a result, every test in epg-tests is skipped on a
system with "gpg2" present (even if "gpg" is also present).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Tue, 17 May 2016 08:50:02 GMT) Full text and rfc822 format available.

Message #6 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: Daiki Ueno <ueno <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Tue, 17 May 2016 17:48:42 +0900
[Message part 1 (text/plain, inline)]
Glenn Morris <rgm <at> gnu.org> writes:

> Since f93d669a, epg-gpg-program defaults to gpg2 if present (which it is
> on most systems, I guess). epg-tests-gpg-usable, however, requires gpg
> version 1 (in the 'require-passphrase case, which is what every test in
> epg-tests uses). As a result, every test in epg-tests is skipped on a
> system with "gpg2" present (even if "gpg" is also present).

I am actually not sure how to cleanly solve this issue, but as long as
"gpg2" is GnuPG 2.0, the attached patch should work around the issue (if
"gpg2" is upgraded to 2.1, another issue will arise, though).

Regards,
-- 
Daiki Ueno
[0001-Adjust-to-epg-configuration-deprecation.patch (text/x-patch, inline)]
From d43d3e66b5582c1e5b8e61eaf7f3ac8866c997a4 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno <at> gnu.org>
Date: Tue, 17 May 2016 17:46:31 +0900
Subject: [PATCH] Adjust to epg-configuration deprecation.

* test/lisp/epg-tests.el (epg-tests-gpg-usable): Use
`epg-find-configuration' instead of deprecated
`epg-configuration'.
---
 test/lisp/epg-tests.el | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el
index 4a31797..06e6f25 100644
--- a/test/lisp/epg-tests.el
+++ b/test/lisp/epg-tests.el
@@ -30,16 +30,20 @@ epg-tests-data-directory
   (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY"))
   "Directory containing epg test data.")
 
+;; If a passphrase is required, we can only use GnuPG 1.x, as GnuPG
+;; 2.0 or later involves gpg-agent, which prevents injecting
+;; passphrase reliably.
 (defun epg-tests-gpg-usable (&optional require-passphrase)
-  (and (executable-find epg-gpg-program)
-       (condition-case nil
-	   (progn
-	     (epg-check-configuration (epg-configuration))
-	     (if require-passphrase
-		 (string-match "\\`1\\."
-			       (cdr (assq 'version (epg-configuration))))
-	       t))
-	 (error nil))))
+  (let ((config (epg-find-configuration 'OpenPGP)))
+    (and config
+         (condition-case nil
+             (progn
+               (epg-check-configuration config)
+               (if require-passphrase
+                   (string-match "\\`1\\."
+                                 (cdr (assq 'version config)))
+                 t))
+           (error nil)))))
 
 (defun epg-tests-passphrase-callback (_c _k _d)
   ;; Need to create a copy here, since the string will be wiped out
-- 
2.5.5


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Wed, 18 May 2016 15:45:02 GMT) Full text and rfc822 format available.

Message #9 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Daiki Ueno <ueno <at> gnu.org>
Cc: 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Wed, 18 May 2016 11:44:16 -0400
> as long as "gpg2" is GnuPG 2.0

epg-config--program-alist requires gpg2 to be in the 2.1 series, so that
seems a bit contradictory?

If these are tests for gpg v1, could you not bind epg-gpg-program to
"gpg" in epg-tests-gpg-usable and with-epg-tests (when
require-passphrase is set)?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Thu, 19 May 2016 01:42:02 GMT) Full text and rfc822 format available.

Message #12 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: Daiki Ueno <ueno <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Thu, 19 May 2016 10:40:49 +0900
Glenn Morris <rgm <at> gnu.org> writes:

>> as long as "gpg2" is GnuPG 2.0
>
> epg-config--program-alist requires gpg2 to be in the 2.1 series, so that
> seems a bit contradictory?
>
> If these are tests for gpg v1, could you not bind epg-gpg-program to
> "gpg" in epg-tests-gpg-usable and with-epg-tests (when
> require-passphrase is set)?

The problem is that some distributions rename "gpg2" to "gpg" and it's
not that simple to detect it's v1.  Maybe a better solution would be to
define `epg-config--program-alist' as a normal defvar rather than
defconst, bind it in `with-epg-tests', and find the correct gpg v1
executable.  I'll try to write a patch later today.

Regards,
-- 
Daiki Ueno




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Thu, 19 May 2016 09:14:02 GMT) Full text and rfc822 format available.

Message #15 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: Daiki Ueno <ueno <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Thu, 19 May 2016 18:12:59 +0900
Daiki Ueno <ueno <at> gnu.org> writes:

> The problem is that some distributions rename "gpg2" to "gpg" and it's
> not that simple to detect it's v1.  Maybe a better solution would be to
> define `epg-config--program-alist' as a normal defvar rather than
> defconst, bind it in `with-epg-tests', and find the correct gpg v1
> executable.  I'll try to write a patch later today.

I have pushed this:
http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=d4ae6d7033b34e8b75c59aaf1584131e439ef2d5

Regards,
-- 
Daiki Ueno




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Wed, 25 May 2016 17:08:02 GMT) Full text and rfc822 format available.

Message #18 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Daiki Ueno <ueno <at> gnu.org>
Cc: 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Wed, 25 May 2016 13:07:35 -0400
Thanks. Works for me on RHEL 7.2, but on hydra the tests are still skipped.

From previous investigation, they have a "gpg2" binary that is 2.0.27
and a "gpg" one that is 1.4 (?). We can see that package-test-signed is
not skipped. See eg

http://hydra.nixos.org/build/36146533/log/raw
http://hydra.nixos.org/build/36146533




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Fri, 30 Jun 2017 03:38:01 GMT) Full text and rfc822 format available.

Message #21 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Glenn Morris <rgm <at> gnu.org>
Cc: Daiki Ueno <ueno <at> gnu.org>, 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Thu, 29 Jun 2017 23:38:47 -0400
[Message part 1 (text/plain, inline)]
tags 23561 + patch
quit

Glenn Morris <rgm <at> gnu.org> writes:

> Thanks. Works for me on RHEL 7.2, but on hydra the tests are still skipped.
>
> From previous investigation, they have a "gpg2" binary that is 2.0.27
> and a "gpg" one that is 1.4 (?).

Since Bug#23619 is fixed, I think it's just a matter of removing the
check for gpg 1.4.3, I'll push the following in a couple of days if
there are no objections.

[0001-Don-t-skip-epg-tests-Bug-23561.patch (text/x-diff, inline)]
From 67b8a8abc33e694ca275dff3586b605a89f07c62 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Thu, 29 Jun 2017 23:28:15 -0400
Subject: [PATCH] Don't skip epg tests (Bug#23561)

* test/lisp/epg-tests.el (with-epg-tests): Ignore REQUIRE-PASSPHRASE
parameter, since we supply the passphrase via pinentry-program for all
GPG versions (as of 2017-02-28 "Fix epg-tests with dummy-pinentry
program (Bug#23619)").
(epg-tests-program-alist-for-passphrase-callback): Remove.
---
 test/lisp/epg-tests.el | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/test/lisp/epg-tests.el b/test/lisp/epg-tests.el
index 9dd093e792..36db478801 100644
--- a/test/lisp/epg-tests.el
+++ b/test/lisp/epg-tests.el
@@ -30,17 +30,8 @@ (defvar epg-tests-data-directory
   (expand-file-name "data/epg" (getenv "EMACS_TEST_DIRECTORY"))
   "Directory containing epg test data.")
 
-(defconst epg-tests-program-alist-for-passphrase-callback
-  '((OpenPGP
-     nil
-     ("gpg" . "1.4.3"))))
-
-(defun epg-tests-find-usable-gpg-configuration (&optional require-passphrase)
-  (epg-find-configuration
-   'OpenPGP
-   'no-cache
-   (if require-passphrase
-       epg-tests-program-alist-for-passphrase-callback)))
+(defun epg-tests-find-usable-gpg-configuration (&optional _require-passphrase)
+  (epg-find-configuration 'OpenPGP 'no-cache))
 
 (defun epg-tests-passphrase-callback (_c _k _d)
   ;; Need to create a copy here, since the string will be wiped out
-- 
2.11.1


Added tag(s) patch. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 30 Jun 2017 03:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Fri, 07 Jul 2017 02:09:02 GMT) Full text and rfc822 format available.

Message #26 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Glenn Morris <rgm <at> gnu.org>
Cc: Daiki Ueno <ueno <at> gnu.org>, 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Thu, 06 Jul 2017 22:10:04 -0400
tags 23561 + pending
quit

npostavs <at> users.sourceforge.net writes:

> Since Bug#23619 is fixed, I think it's just a matter of removing the
> check for gpg 1.4.3, I'll push the following in a couple of days if
> there are no objections.

Pushed to master [1: 1eefada3f2], I'll wait to close this bug until we
actually see a successful log.

[1: 1eefada3f2]: 2017-07-06 19:54:07 -0400
  Don't skip epg tests (Bug#23561)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1eefada3f277e533cf74bc77ecd36f42c07a96cb




Added tag(s) pending. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 07 Jul 2017 02:09:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Sun, 09 Jul 2017 23:35:01 GMT) Full text and rfc822 format available.

Message #31 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: npostavs <at> users.sourceforge.net
Cc: Daiki Ueno <ueno <at> gnu.org>, 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Sun, 09 Jul 2017 19:34:01 -0400
Thanks, but the tests are still skipped. Eg

http://hydra.nixos.org/build/56062865/nixlog/1




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Tue, 11 Jul 2017 02:04:01 GMT) Full text and rfc822 format available.

Message #34 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Glenn Morris <rgm <at> gnu.org>
Cc: Daiki Ueno <ueno <at> gnu.org>, 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Mon, 10 Jul 2017 22:04:25 -0400
tags 23561 = confirmed
quit

Glenn Morris <rgm <at> gnu.org> writes:

> Thanks, but the tests are still skipped.

Yes, the only difference left between this and the package-tests is the
'no-cache' argument, though I haven't quite worked out how the cache
gets filled for package-tests in the first place.

> Eg
>
> http://hydra.nixos.org/build/56062865/nixlog/1

That shows "(Unavailable)",
https://nix-cache.s3.amazonaws.com/log/33r5bbd5i8gdxf4p70kag5bssabl9rg0-emacs-coverage-unknown.drv
seems okay.




Added tag(s) confirmed; removed tag(s) pending and patch. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Tue, 11 Jul 2017 02:04:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Sun, 23 Jul 2017 05:01:02 GMT) Full text and rfc822 format available.

Message #39 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Glenn Morris <rgm <at> gnu.org>
Cc: Daiki Ueno <ueno <at> gnu.org>, 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Sun, 23 Jul 2017 01:02:09 -0400
npostavs <at> users.sourceforge.net writes:

> Yes, the only difference left between this and the package-tests is the
> 'no-cache' argument, though I haven't quite worked out how the cache
> gets filled for package-tests in the first place.

package-test-signed calls (epg-check-configuration (epg-configuration)),
the obsolete `epg-configuration' functions fills the cache without
checking the version, and epg-check-configuration only checks against
epg-gpg-minimum-version which is "1.4.3", hence 2.0.x can satisfy it.

Then when (epg-find-configuration 'OpenPGP) is called, the cache already
has the 2.0 config in it, and so just uses that instead of rejecting
"gpg2" for being less than 2.1.6.

[1: e80c2a7b47] says that "Emacs doesn't work well with 2.0 series".
But if I understand correctly, Glenn is now seeing all the tests pass
using 2.0.22 (cf [2: 24d06313c4]), so...

[1: e80c2a7b47]: 2016-02-17 16:47:24 +0900
  Make GnuPG version check robuster
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e80c2a7b47d161f00aac096b9d58a18879a122e8

[2: 24d06313c4]: 2017-05-15 21:01:30 -0400
  Stop some epg tests failing on rhel7 with gpg 2.0.22 (bug#23619)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=24d06313c4f205061fb74c9665d5819a05362636




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Fri, 13 Jul 2018 12:26:02 GMT) Full text and rfc822 format available.

Message #42 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Daiki Ueno <ueno <at> gnu.org>, 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Fri, 13 Jul 2018 08:25:33 -0400
Glenn Morris <rgm <at> gnu.org> writes:

> Thanks. Works for me on RHEL 7.2, but on hydra the tests are still skipped.
>
>>From previous investigation, they have a "gpg2" binary that is 2.0.27
> and a "gpg" one that is 1.4 (?). We can see that package-test-signed is
> not skipped. See eg
>
> http://hydra.nixos.org/build/36146533/log/raw
> http://hydra.nixos.org/build/36146533

I recently tried to fix this again [1: 1222ff5275], but it didn't work.
However, I see that package-test-signed is also skipped[2].  Does that
mean gpg isn't installed at all anymore?

[1: 1222ff5275]: 2018-07-12 21:45:30 -0400
  Don't skip epg-tests even with gpg 2.0 (Bug#23561)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1222ff5275e61e797d388489b8a88f499247321d

[2]: https://nix-cache.s3.amazonaws.com/log/pxd5kq55rryri9qncacw66qlbj6nj0q1-emacs-coverage-unknown.drv




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Fri, 13 Jul 2018 16:55:01 GMT) Full text and rfc822 format available.

Message #45 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Daiki Ueno <ueno <at> gnu.org>, 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Fri, 13 Jul 2018 12:54:00 -0400
Noam Postavsky wrote:

> However, I see that package-test-signed is also skipped[2].  Does that
> mean gpg isn't installed at all anymore?

I don't know what the cause of [2] is, but gnupg is still installed.
See the build dependencies tab on the hydra jobset webpage, and also the
coverage buildinputs line in

https://git.savannah.gnu.org/cgit/hydra-recipes.git/tree/emacs/release.nix




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Mon, 16 Jul 2018 11:30:03 GMT) Full text and rfc822 format available.

Message #48 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Daiki Ueno <ueno <at> gnu.org>, 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Mon, 16 Jul 2018 07:29:48 -0400
close 23561 
quit

Glenn Morris <rgm <at> gnu.org> writes:

> Noam Postavsky wrote:
>
>> However, I see that package-test-signed is also skipped[2].  Does that
>> mean gpg isn't installed at all anymore?
>
> I don't know what the cause of [2] is, but gnupg is still installed.

The config check was failing due to HOME not existing (I didn't see that
locally, because I had a wrapper script to pretend to have a different
gpg version).  Fixed in [3: 10a7e91956].

Then it turns out the passphrase doesn't work for symmetric tests[4], I
assume it's some quirk of that version, so I've set those to skip [7:
7acb87ab97], [10: 4318d70677].


[3: 10a7e91956]: 2018-07-14 23:45:27 -0400
  Fix gpg detection for tests (Bug#23561)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=10a7e91956ebc5d808c88aecffb9d71a568d0233

[4]: https://nix-cache.s3.amazonaws.com/log/gjkmrr81ah59lyyi7q6ykpaiba9ps5ir-emacs-coverage-unknown.drv

[7: 7acb87ab97]: 2018-07-15 16:26:22 -0400
  Don't test symmetric operations on gpg 2.0 (Bug#23561)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=7acb87ab97082026e692e1d1d679df2313148343

[10: 4318d70677]: 2018-07-15 21:51:54 -0400
  Reject gpg 2.0 for epg configs by default (Bug#23561)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4318d70677dedea12a3dcfb689bce71e409212f0




bug closed, send any further explanations to 23561 <at> debbugs.gnu.org and Glenn Morris <rgm <at> gnu.org> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 16 Jul 2018 11:30:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23561; Package emacs. (Tue, 24 Jul 2018 17:48:02 GMT) Full text and rfc822 format available.

Message #53 received at 23561 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Daiki Ueno <ueno <at> gnu.org>, 23561 <at> debbugs.gnu.org
Subject: Re: bug#23561: epg tests are (almost) always skipped
Date: Tue, 24 Jul 2018 13:47:25 -0400
Thanks for looking into this so thoroughly.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 22 Aug 2018 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 306 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.