1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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 GPGTAR (path-join (getenv "objdir") "tools" (qualify "gpgtar")))
(define (untar-armored source-name) (define (untar-armored source-name)
(pipe:do (with-ephemeral-home-directory (lambda ())
(pipe:open source-name (logior O_RDONLY O_BINARY)) (pipe:do
(pipe:spawn `(,@GPG --dearmor)) (pipe:open source-name (logior O_RDONLY O_BINARY))
(pipe:spawn `(,GPGTAR --extract --directory=. -)))) (pipe:spawn `(,@GPG --dearmor))
(pipe:spawn `(,GPGTAR --extract --directory=. -)))))
(define (run-test message src-tarball test) (define (run-test message src-tarball test)
(catch (skip "gpgtar not built") (catch (skip "gpgtar not built")

View File

@ -201,7 +201,8 @@
(define have-opt-always-trust (define have-opt-always-trust
(catch #f (catch #f
(call-check `(,(tool 'gpg) --gpgconf-test --always-trust)) (with-ephemeral-home-directory (lambda ())
(call-check `(,(tool 'gpg) --gpgconf-test --always-trust)))
#t)) #t))
(define GPG `(,(tool 'gpg) --no-permission-warning (define GPG `(,(tool 'gpg) --no-permission-warning