mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
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@g10code.com>
This commit is contained in:
parent
0801f49b0d
commit
8b1611a960
@ -253,6 +253,7 @@
|
|||||||
|
|
||||||
(setenv "GPG_AGENT_INFO" "" #t)
|
(setenv "GPG_AGENT_INFO" "" #t)
|
||||||
(setenv "GNUPGHOME" (getcwd) #t)
|
(setenv "GNUPGHOME" (getcwd) #t)
|
||||||
|
(define GNUPGHOME (getcwd))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; GnuPG helper.
|
;; GnuPG helper.
|
||||||
|
@ -20,10 +20,6 @@
|
|||||||
(load (with-path "defs.scm"))
|
(load (with-path "defs.scm"))
|
||||||
(setup-environment)
|
(setup-environment)
|
||||||
|
|
||||||
(define GNUPGHOME (getenv "GNUPGHOME"))
|
|
||||||
(if (string=? "" GNUPGHOME)
|
|
||||||
(fail "GNUPGHOME not set"))
|
|
||||||
|
|
||||||
(setenv "SSH_AUTH_SOCK"
|
(setenv "SSH_AUTH_SOCK"
|
||||||
(call-check `(,(tool 'gpgconf) --null --list-dirs agent-ssh-socket))
|
(call-check `(,(tool 'gpgconf) --null --list-dirs agent-ssh-socket))
|
||||||
#t)
|
#t)
|
||||||
@ -55,7 +51,7 @@
|
|||||||
car keys)
|
car keys)
|
||||||
|
|
||||||
(info "Checking for issue2316...")
|
(info "Checking for issue2316...")
|
||||||
(unlink (string-append GNUPGHOME "/sshcontrol"))
|
(unlink (path-join GNUPGHOME "sshcontrol"))
|
||||||
(pipe:do
|
(pipe:do
|
||||||
(pipe:open (path-join (in-srcdir "samplekeys")
|
(pipe:open (path-join (in-srcdir "samplekeys")
|
||||||
(string-append "ssh-rsa.key"))
|
(string-append "ssh-rsa.key"))
|
||||||
|
@ -30,9 +30,6 @@
|
|||||||
|
|
||||||
;; Redefine GPG without --always-trust and a fixed time.
|
;; Redefine GPG without --always-trust and a fixed time.
|
||||||
(define GPG `(,(tool 'gpg) --no-permission-warning ,(faketime 0)))
|
(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")
|
(catch (skip "Tofu not supported")
|
||||||
(call-check `(,@GPG --trust-model=tofu --list-config)))
|
(call-check `(,@GPG --trust-model=tofu --list-config)))
|
||||||
@ -106,7 +103,7 @@
|
|||||||
(info "Checking tofu policies and trust...")
|
(info "Checking tofu policies and trust...")
|
||||||
|
|
||||||
;; Carefully remove the TOFU db.
|
;; 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
|
;; Verify a message. There should be no conflict and the trust
|
||||||
;; policy should be set to auto.
|
;; policy should be set to auto.
|
||||||
@ -205,7 +202,7 @@
|
|||||||
))
|
))
|
||||||
|
|
||||||
;; Carefully remove the TOFU db.
|
;; 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 "1C005AF3" 0 0 0 0)
|
||||||
(check-counts "BE04EB2B" 0 0 0 0)
|
(check-counts "BE04EB2B" 0 0 0 0)
|
||||||
@ -288,7 +285,7 @@
|
|||||||
--faked-system-time=1476304861))
|
--faked-system-time=1476304861))
|
||||||
|
|
||||||
;; Carefully remove the TOFU db.
|
;; Carefully remove the TOFU db.
|
||||||
(catch '() (unlink (string-append GNUPGHOME "/tofu.db")))
|
(catch '() (unlink (path-join GNUPGHOME "tofu.db")))
|
||||||
|
|
||||||
(define DIR "tofu/cross-sigs")
|
(define DIR "tofu/cross-sigs")
|
||||||
;; The test keys.
|
;; The test keys.
|
||||||
@ -380,7 +377,7 @@
|
|||||||
--faked-system-time=1476304861))
|
--faked-system-time=1476304861))
|
||||||
|
|
||||||
;; Carefully remove the TOFU db.
|
;; Carefully remove the TOFU db.
|
||||||
(catch '() (unlink (string-append GNUPGHOME "/tofu.db")))
|
(catch '() (unlink (path-join GNUPGHOME "tofu.db")))
|
||||||
|
|
||||||
(define DIR "tofu/cross-sigs")
|
(define DIR "tofu/cross-sigs")
|
||||||
;; The test keys.
|
;; The test keys.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user