From 32b75fb7743f35936d7014fce33c90ba97dfa374 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 4 Apr 2017 14:32:04 +0200 Subject: 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 --- tests/gpgsm/export.scm | 2 +- tests/gpgsm/setup.scm | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'tests/gpgsm') diff --git a/tests/gpgsm/export.scm b/tests/gpgsm/export.scm index 1ee91e491..47fb06e20 100644 --- a/tests/gpgsm/export.scm +++ b/tests/gpgsm/export.scm @@ -25,7 +25,7 @@ (lambda (cert) (lettmp (exported) (call-check `(,@gpgsm --output ,exported --export ,cert::uid::CN)) - (with-ephemeral-home-directory + (with-ephemeral-home-directory setup-gpgsm-environment (call-check `(,@gpgsm --import ,exported)) (assert (sm-have-public-key? cert))))) (lambda (cert) cert::uid::CN) diff --git a/tests/gpgsm/setup.scm b/tests/gpgsm/setup.scm index 91821a0f8..aa1ab4132 100644 --- a/tests/gpgsm/setup.scm +++ b/tests/gpgsm/setup.scm @@ -23,8 +23,6 @@ (unless (and tarball (not (null? tarball))) (error "Usage: setup.scm --create-tarball ...")) -(with-ephemeral-home-directory - (chdir (getenv "GNUPGHOME")) - (create-gpgsmhome) - (stop-agent) - (call-check `(,(tool 'gpgtar) --create --output ,(car tarball) "."))) +(setenv "GNUPGHOME" (getcwd) #t) +(create-gpgsmhome) +(call-check `(,(tool 'gpgtar) --create --output ,(car tarball) ".")) -- cgit v1.2.3