diff options
author | Justus Winter <[email protected]> | 2017-04-04 12:32:04 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-04-04 16:52:06 +0000 |
commit | 32b75fb7743f35936d7014fce33c90ba97dfa374 (patch) | |
tree | b873add1fbe3813b090eac16cd0beec752364916 /tests/openpgp/defs.scm | |
parent | gpgscm: Fix copying values. (diff) | |
download | gnupg-32b75fb7743f35936d7014fce33c90ba97dfa374.tar.gz gnupg-32b75fb7743f35936d7014fce33c90ba97dfa374.zip |
tests: Fix setup of ephemeral home directories.
* tests/openpgp/defs.scm (with-ephemeral-home-directory): Create
configuration files when we enter the context.
* tests/openpgp/setup.scm: Do not use an ephemeral home directory.
Tests should always use the cwd.
* tests/gpgsm/setup.scm: Likewise.
* tests/gpgsm/export.scm: Add explicit constructor function.
* tests/openpgp/decrypt-session-key.scm: Likewise.
* tests/openpgp/decrypt-unwrap-verify.scm: Likewise.
--
Previously, ephemeral homedirectories lacked a configuration, hence
GnuPG tried to start backend daemons using their installed locations.
Fix this by explicitly creating a suitable configuration.
GnuPG-bug-id: 3047
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tests/openpgp/defs.scm')
-rw-r--r-- | tests/openpgp/defs.scm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/openpgp/defs.scm b/tests/openpgp/defs.scm index e8d06c048..4271ba04a 100644 --- a/tests/openpgp/defs.scm +++ b/tests/openpgp/defs.scm @@ -289,14 +289,18 @@ ;; Evaluate a sequence of expressions with an ephemeral home ;; directory. -(define-macro (with-ephemeral-home-directory . expressions) +(define-macro (with-ephemeral-home-directory setup-fn . expressions) (let ((original-home-directory (gensym)) - (ephemeral-home-directory (gensym))) + (ephemeral-home-directory (gensym)) + (setup (gensym))) `(let ((,original-home-directory (getenv "GNUPGHOME")) - (,ephemeral-home-directory (mkdtemp))) + (,ephemeral-home-directory (mkdtemp)) + (,setup (delay (,setup-fn)))) (finally (unlink-recursively ,ephemeral-home-directory) (dynamic-wind - (lambda () (setenv "GNUPGHOME" ,ephemeral-home-directory #t)) + (lambda () + (force ,setup) + (setenv "GNUPGHOME" ,ephemeral-home-directory #t)) (lambda () ,@expressions) (lambda () (setenv "GNUPGHOME" ,original-home-directory #t))))))) |