From e694e2a9b05e75a31c209c499400a2cb0fade2e9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 1 Oct 2014 19:24:28 -0400 Subject: [PATCH] package-test tweaks for hydra * test/automated/package-test.el (with-package-test, package-test-signed): Also set HOME to a temp value, in case the real one is absent (e.g. hydra) or read-only. (package-test-signed): Use skip-unless rather than expected-result. Fixes: debbugs:18575 --- test/ChangeLog | 7 +++++++ test/automated/package-test.el | 14 ++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index dcab604dbb1..264173fa557 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2014-10-01 Glenn Morris + + * automated/package-test.el (with-package-test, package-test-signed): + Also set HOME to a temp value, in case the real one is absent (e.g. + hydra) or read-only. (Bug#18575) + (package-test-signed): Use skip-unless rather than expected-result. + 2014-09-01 Fabián Ezequiel Gallina * automated/python-tests.el: diff --git a/test/automated/package-test.el b/test/automated/package-test.el index 65e13438ea1..f21e1421a8d 100644 --- a/test/automated/package-test.el +++ b/test/automated/package-test.el @@ -89,6 +89,8 @@ "Set up temporary locations and variables for testing." (declare (indent 1)) `(let* ((package-test-user-dir (make-temp-file "pkg-test-user-dir-" t)) + (process-environment (cons (format "HOME=%s" package-test-user-dir) + process-environment)) (package-user-dir package-test-user-dir) (package-archives `(("gnu" . ,package-test-data-dir))) (old-yes-no-defn (symbol-function 'yes-or-no-p)) @@ -360,11 +362,15 @@ Must called from within a `tar-mode' buffer." (ert-deftest package-test-signed () "Test verifying package signature." - :expected-result (condition-case nil - (progn + (skip-unless (ignore-errors + (let ((homedir (make-temp-file "package-test" t))) + (unwind-protect + (let ((process-environment + (cons (format "HOME=%s" homedir) + process-environment))) (epg-check-configuration (epg-configuration)) - :passed) - (error :failed)) + t) + (delete-directory homedir t))))) (let* ((keyring (expand-file-name "key.pub" package-test-data-dir)) (package-test-data-dir (expand-file-name "data/package/signed" package-test-file-dir))) -- 2.39.2