[Pkg-gnupg-commit] [gnupg2] 73/116: tests: Improve GPGHOME handling.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Tue Jan 24 04:40:55 UTC 2017


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

dkg pushed a commit to branch master
in repository gnupg2.

commit 8b1611a9605b636db3e07a9d81016a11b318724c
Author: Justus Winter <justus at g10code.com>
Date:   Mon Jan 16 13:59:56 2017 +0100

    tests: Improve GPGHOME handling.
    
    * tests/openpgp/defs.scm (GPGHOME): New variable.
    * tests/openpgp/ssh-import.scm: Remove redundant code, use 'path-join'.
    * tests/openpgp/tofu.scm: Likewise.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 tests/openpgp/defs.scm       |  1 +
 tests/openpgp/ssh-import.scm |  6 +-----
 tests/openpgp/tofu.scm       | 11 ++++-------
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/tests/openpgp/defs.scm b/tests/openpgp/defs.scm
index 548476b..1d8173d 100644
--- a/tests/openpgp/defs.scm
+++ b/tests/openpgp/defs.scm
@@ -253,6 +253,7 @@
 
 (setenv "GPG_AGENT_INFO" "" #t)
 (setenv "GNUPGHOME" (getcwd) #t)
+(define GNUPGHOME (getcwd))
 
 ;;
 ;; GnuPG helper.
diff --git a/tests/openpgp/ssh-import.scm b/tests/openpgp/ssh-import.scm
index e8f12d3..ad5acc5 100755
--- a/tests/openpgp/ssh-import.scm
+++ b/tests/openpgp/ssh-import.scm
@@ -20,10 +20,6 @@
 (load (with-path "defs.scm"))
 (setup-environment)
 
-(define GNUPGHOME (getenv "GNUPGHOME"))
-(if (string=? "" GNUPGHOME)
-    (fail "GNUPGHOME not set"))
-
 (setenv "SSH_AUTH_SOCK"
         (call-check `(,(tool 'gpgconf) --null --list-dirs agent-ssh-socket))
         #t)
@@ -55,7 +51,7 @@
  car keys)
 
 (info "Checking for issue2316...")
-(unlink (string-append GNUPGHOME "/sshcontrol"))
+(unlink (path-join GNUPGHOME "sshcontrol"))
 (pipe:do
  (pipe:open (path-join (in-srcdir "samplekeys")
 		       (string-append "ssh-rsa.key"))
diff --git a/tests/openpgp/tofu.scm b/tests/openpgp/tofu.scm
index cfcd5c8..ca5786b 100755
--- a/tests/openpgp/tofu.scm
+++ b/tests/openpgp/tofu.scm
@@ -30,9 +30,6 @@
 
 ;; Redefine GPG without --always-trust and a fixed time.
 (define GPG `(,(tool 'gpg) --no-permission-warning ,(faketime 0)))
-(define GNUPGHOME (getenv "GNUPGHOME"))
-(if (string=? "" GNUPGHOME)
-    (fail "GNUPGHOME not set"))
 
 (catch (skip "Tofu not supported")
        (call-check `(, at GPG --trust-model=tofu --list-config)))
@@ -106,7 +103,7 @@
 (info "Checking tofu policies and trust...")
 
 ;; Carefully remove the TOFU db.
-(catch '() (unlink (string-append GNUPGHOME "/tofu.db")))
+(catch '() (unlink (path-join GNUPGHOME "tofu.db")))
 
 ;; Verify a message.  There should be no conflict and the trust
 ;; policy should be set to auto.
@@ -205,7 +202,7 @@
     ))
 
 ;; Carefully remove the TOFU db.
-(catch '() (unlink (string-append GNUPGHOME "/tofu.db")))
+(catch '() (unlink (path-join GNUPGHOME "tofu.db")))
 
 (check-counts "1C005AF3" 0 0 0 0)
 (check-counts "BE04EB2B" 0 0 0 0)
@@ -288,7 +285,7 @@
 	      --faked-system-time=1476304861))
 
 ;; Carefully remove the TOFU db.
-(catch '() (unlink (string-append GNUPGHOME "/tofu.db")))
+(catch '() (unlink (path-join GNUPGHOME "tofu.db")))
 
 (define DIR "tofu/cross-sigs")
 ;; The test keys.
@@ -380,7 +377,7 @@
 	      --faked-system-time=1476304861))
 
 ;; Carefully remove the TOFU db.
-(catch '() (unlink (string-append GNUPGHOME "/tofu.db")))
+(catch '() (unlink (path-join GNUPGHOME "tofu.db")))
 
 (define DIR "tofu/cross-sigs")
 ;; The test keys.

-- 
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