Don't test symmetric operations on gpg 2.0 (Bug#23561)

On the Hydra test machines, which have gpg 2.0, the symmetric tests
fail.
* test/lisp/epg-tests.el (with-epg-tests): Pass REQUIRE-PUBLIC-KEY to
`epg-tests-find-usable-gpg-configuration' and call it before
`epg-make-context' so that the latter uses the resulting cached
config.
(epg-tests-find-usable-gpg-configuration): Only allow gpg 2.0 for
symmetric operations.  Clear `epg--configurations' and don't pass
NO-CACHE to `epg-find-configuration'.
(epg-tests--config-program-alist): Use copy-tree to avoid modifying
the epg-config--program-alist cons values.
* test/lisp/emacs-lisp/package-tests.el (package-test-signed): Allow
running with gpg 2.0.
This commit is contained in:
Noam Postavsky 2018-07-15 09:37:59 -04:00
parent 95931085fa
commit 7acb87ab97
2 changed files with 31 additions and 14 deletions

View file

@ -473,7 +473,17 @@ Must called from within a `tar-mode' buffer."
(let ((process-environment
(cons (concat "HOME=" homedir)
process-environment)))
(epg-find-configuration 'OpenPGP))
(epg-find-configuration
'OpenPGP nil
;; By default we require gpg2 2.1+ due to some
;; practical problems with pinentry. But this
;; test works fine with 2.0 as well.
(let ((prog-alist (copy-tree epg-config--program-alist)))
(setf (alist-get "gpg2"
(alist-get 'OpenPGP prog-alist)
nil nil #'equal)
"2.0")
prog-alist)))
(delete-directory homedir t))))
(let* ((keyring (expand-file-name "key.pub" package-test-data-dir))
(package-test-data-dir