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@g10code.com>
This commit is contained in:
Justus Winter 2017-04-11 10:46:09 +02:00
parent ccd2187212
commit 1b28d9dbe0
No known key found for this signature in database
GPG Key ID: DD1A52F9DA8C9020
2 changed files with 7 additions and 5 deletions

View File

@ -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 `(,@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 `(,@GPG --dearmor))
(pipe:spawn `(,GPGTAR --extract --directory=. -)))))
(define (run-test message src-tarball test)
(catch (skip "gpgtar not built")

View File

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