all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daiki Ueno <ueno@gnu.org>
To: Glenn Morris <rgm@gnu.org>
Cc: 23561@debbugs.gnu.org
Subject: bug#23561: epg tests are (almost) always skipped
Date: Tue, 17 May 2016 17:48:42 +0900	[thread overview]
Message-ID: <m3h9dx83yt.fsf-ueno@gnu.org> (raw)
In-Reply-To: <4nwpmtfb9p.fsf@fencepost.gnu.org> (Glenn Morris's message of "Tue, 17 May 2016 02:29:06 -0400")

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

Glenn Morris <rgm@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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Adjust-to-epg-configuration-deprecation.patch --]
[-- Type: text/x-patch, Size: 1723 bytes --]

From d43d3e66b5582c1e5b8e61eaf7f3ac8866c997a4 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@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


  reply	other threads:[~2016-05-17  8:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17  6:29 bug#23561: epg tests are (almost) always skipped Glenn Morris
2016-05-17  8:48 ` Daiki Ueno [this message]
2016-05-18 15:44   ` Glenn Morris
2016-05-19  1:40     ` Daiki Ueno
2016-05-19  9:12       ` Daiki Ueno
2016-05-25 17:07         ` Glenn Morris
2017-06-30  3:38           ` npostavs
2017-07-07  2:10             ` npostavs
2017-07-09 23:34               ` Glenn Morris
2017-07-11  2:04                 ` npostavs
2017-07-23  5:02                   ` npostavs
2018-07-13 12:25           ` Noam Postavsky
2018-07-13 16:54             ` Glenn Morris
2018-07-16 11:29               ` Noam Postavsky
2018-07-24 17:47                 ` Glenn Morris

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

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

  git send-email \
    --in-reply-to=m3h9dx83yt.fsf-ueno@gnu.org \
    --to=ueno@gnu.org \
    --cc=23561@debbugs.gnu.org \
    --cc=rgm@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.