summaryrefslogtreecommitdiffstats
path: root/tests/gpgsm
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2017-03-06 17:16:41 +0100
committerJustus Winter <justus@g10code.com>2017-03-06 18:10:10 +0100
commit7e19786a5ddef637d1d9d21593fecf5a36b6f372 (patch)
tree99a84f29f96786d50228cf260f2c5d4ed929be97 /tests/gpgsm
parentgpgscm: Fix creation of temporary directories. (diff)
downloadgnupg2-7e19786a5ddef637d1d9d21593fecf5a36b6f372.tar.xz
gnupg2-7e19786a5ddef637d1d9d21593fecf5a36b6f372.zip
tests: Harmonize temporary and socket directory handling.
* tests/gpgscm/tests.scm (mkdtemp): Do not magically obey the environment variable 'TMP', make sure to always return an absolute path. * tests/gpgme/Makefile.am (TMP): Drop variable. (TESTS_ENVIRONMENT): Drop 'TMP'. * tests/gpgme/gpgme-defs.scm (create-gpgmehome): Start the agent. Do not create private key store, the agent does that for us. * tests/gpgsm/Makefile.am (TMP): Drop variable. (TESTS_ENVIRONMENT): Drop 'TMP'. * tests/gpgme/gpgme-defs.scm (create-gpgsmhome): Start the agent. Do not create private key store, the agent does that for us. * tests/migrations/Makefile.am (TMP): Drop variable. (TESTS_ENVIRONMENT): Drop 'TMP'. * tests/migrations/common.scm (gpgconf): New variable. (run-test): Create and remove socket directory. * tests/migrations/extended-pkf.scm (src-tarball): Remove variable. (setup): Remove function. (trigger-migration): Likewise. Use 'run-test' to execute the test. * tests/migrations/from-classic.scm (src-tarball): Remove variable. (setup): Remove function. Use 'run-test' to execute the tests. * tests/openpgp/Makefile.am (TMP): Drop variable. (TESTS_ENVIRONMENT): Drop 'TMP'. * tests/openpgp/README: Do not mention 'TMP'. * tests/openpgp/defs.scm (with-home-directory): New macro. (create-legacy-gpghome): Do not create private key store, the agent does that for us. (start-agent): Make sure to terminate the right agent with 'atexit'. -- Previously, the test suite relied upon creating home directories in '/tmp'. This has been problematic in some build environments, although POSIX mandates that '/tmp' must be available. We now rely on 'gpgconf --create-socketdir' to create a suitable socket directory for us. This allows us to get rid of some cruft. It also aligns the environment the tests are run in closer with the environment that we intend that GnuPG runs in. Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'tests/gpgsm')
-rw-r--r--tests/gpgsm/Makefile.am3
-rw-r--r--tests/gpgsm/gpgsm-defs.scm2
2 files changed, 1 insertions, 4 deletions
diff --git a/tests/gpgsm/Makefile.am b/tests/gpgsm/Makefile.am
index aad328bef..28db50133 100644
--- a/tests/gpgsm/Makefile.am
+++ b/tests/gpgsm/Makefile.am
@@ -28,12 +28,9 @@ include $(top_srcdir)/am/cmacros.am
AM_CFLAGS =
-TMP ?= /tmp
-
TESTS_ENVIRONMENT = LC_ALL=C \
EXEEXT=$(EXEEXT) \
PATH=../gpgscm:$(PATH) \
- TMP=$(TMP) \
srcdir=$(abs_srcdir) \
objdir=$(abs_top_builddir) \
GPGSCM_PATH=$(abs_top_srcdir)/tests/gpgscm:$(abs_top_srcdir)/tests/openpgp:$(abs_top_srcdir)/tests/gpgsm
diff --git a/tests/gpgsm/gpgsm-defs.scm b/tests/gpgsm/gpgsm-defs.scm
index aa5af3d59..5f9be7f0f 100644
--- a/tests/gpgsm/gpgsm-defs.scm
+++ b/tests/gpgsm/gpgsm-defs.scm
@@ -73,6 +73,7 @@
"faked-system-time 1008241200")
(create-file "gpg-agent.conf"
(string-append "pinentry-program " (tool 'pinentry)))
+ (start-agent)
(create-file
"trustlist.txt"
"32100C27173EF6E9C4E9A25D3D69F86D37A4F939"
@@ -80,7 +81,6 @@
"3CF405464F66ED4A7DF45BBDD1E4282E33BDB76E S")
(log "Storing private keys")
- (mkdir "private-keys-v1.d" "-rwx")
(for-each
(lambda (name)
(file-copy (in-srcdir name)