[Pkg-gnupg-commit] [gnupg2] 49/132: tests: Make tests more robust.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed May 17 03:07:41 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit 1b28d9dbe0260b2a4645c4b5caae11d9f375c942
Author: Justus Winter <justus at g10code.com>
Date:   Tue Apr 11 10:46:09 2017 +0200

    tests: Make tests more robust.
    
    * tests/openpgp/defs.scm (have-opt-always-trust): Execute in empty
    ephemeral home directory.  This prevents gpg from picking up the
    configuration from the current gnupghome (if any).
    * tests/migrations/common.scm (untar-armored): Likewise.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 tests/migrations/common.scm | 9 +++++----
 tests/openpgp/defs.scm      | 3 ++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/migrations/common.scm b/tests/migrations/common.scm
index fa8f129..cba6590 100644
--- a/tests/migrations/common.scm
+++ b/tests/migrations/common.scm
@@ -39,10 +39,11 @@
 (define GPGTAR (path-join (getenv "objdir") "tools" (qualify "gpgtar")))
 
 (define (untar-armored source-name)
-  (pipe:do
-   (pipe:open source-name (logior O_RDONLY O_BINARY))
-   (pipe:spawn `(, at GPG --dearmor))
-   (pipe:spawn `(,GPGTAR --extract --directory=. -))))
+  (with-ephemeral-home-directory (lambda ())
+    (pipe:do
+     (pipe:open source-name (logior O_RDONLY O_BINARY))
+     (pipe:spawn `(, at GPG --dearmor))
+     (pipe:spawn `(,GPGTAR --extract --directory=. -)))))
 
 (define (run-test message src-tarball test)
   (catch (skip "gpgtar not built")
diff --git a/tests/openpgp/defs.scm b/tests/openpgp/defs.scm
index cb22de7..c4b321c 100644
--- a/tests/openpgp/defs.scm
+++ b/tests/openpgp/defs.scm
@@ -201,7 +201,8 @@
 
 (define have-opt-always-trust
   (catch #f
-	 (call-check `(,(tool 'gpg) --gpgconf-test --always-trust))
+	 (with-ephemeral-home-directory (lambda ())
+	   (call-check `(,(tool 'gpg) --gpgconf-test --always-trust)))
 	 #t))
 
 (define GPG `(,(tool 'gpg) --no-permission-warning

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list