aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/openpgp/ChangeLog10
-rw-r--r--tests/openpgp/Makefile.am8
-rwxr-xr-xtests/openpgp/defs.inc28
-rwxr-xr-xtests/openpgp/genkey1024.test4
5 files changed, 39 insertions, 13 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c4693c01d..7c231ff6e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -30,7 +30,7 @@ SUBDIRS = ${openpgp} . pkits
GPGSM = ../sm/gpgsm
# Note that we need to use /bin/pwd so that we don't get into trouble
-# if the shell used for inittests would uses an internal version of
+# if the shell used for inittests would use an internal version of
# pwd which handles symlinks differently.
TESTS_ENVIRONMENT = GNUPGHOME=`/bin/pwd` GPG_AGENT_INFO= LC_ALL=C \
GPGSM=$(GPGSM) $(srcdir)/runtest
diff --git a/tests/openpgp/ChangeLog b/tests/openpgp/ChangeLog
index 6afd87c63..566b9815a 100644
--- a/tests/openpgp/ChangeLog
+++ b/tests/openpgp/ChangeLog
@@ -1,3 +1,13 @@
+2010-05-11 Werner Koch <[email protected]>
+
+ * genkey1024.test: Use GPG macro.
+
+ * gpg-agent.conf.tmpl: New.
+ * defs.inc: Create gpg-agent.conf
+ (GNUPGHOME): Set and export.
+ (GPG_AGENT_INFO): Unset
+ * Makefile.am (CLEANFILES): Add S.gpg-agent
+
2009-12-21 Werner Koch <[email protected]>
* Makefile.am (required_pgms): New.
diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am
index 1cdf6edb4..aa99c3e9b 100644
--- a/tests/openpgp/Makefile.am
+++ b/tests/openpgp/Makefile.am
@@ -40,15 +40,19 @@ TESTS = version.test mds.test \
TEST_FILES = pubring.asc secring.asc plain-1o.asc plain-2o.asc plain-3o.asc \
plain-1.asc plain-2.asc plain-3.asc plain-1-pgp.asc \
pubring.pkr.asc secring.skr.asc secdemo.asc pubdemo.asc \
- gpg.conf.tmpl bug537-test.data.asc bug894-test.asc
+ gpg.conf.tmpl gpg-agent.conf.tmpl \
+ bug537-test.data.asc bug894-test.asc
DATA_FILES = data-500 data-9000 data-32000 data-80000 plain-large
EXTRA_DIST = defs.inc $(TESTS) $(TEST_FILES) \
mkdemodirs signdemokey
+
+# Note that removing S.gpg-agent forces a running gpg-agent to
+# terminate after some time.
CLEANFILES = prepared.stamp x y yy z out err $(DATA_FILES) \
plain-1 plain-2 plain-3 trustdb.gpg *.lock .\#lk* \
- *.test.log gpg_dearmor gpg.conf \
+ *.test.log gpg_dearmor gpg.conf gpg-agent.conf S.gpg-agent \
pubring.gpg secring.gpg pubring.pkr secring.skr
DISTCLEANFILES = pubring.gpg~ random_seed
diff --git a/tests/openpgp/defs.inc b/tests/openpgp/defs.inc
index 2a7683eb6..a00aa1372 100755
--- a/tests/openpgp/defs.inc
+++ b/tests/openpgp/defs.inc
@@ -161,14 +161,26 @@ pgmname=`basename $0`
[ -z "$srcdir" ] && fatal "not called from make"
-# Make sure we have a valid option files even with VPATH builds.
-if [ -f ./gpg.conf ]; then
- :
-elif [ -f $srcdir/gpg.conf.tmpl ]; then
- cat $srcdir/gpg.conf.tmpl >gpg.conf
-fi
-
-GPG="../../g10/gpg2 --no-permission-warning --homedir . "
+# Make sure we have a valid option file even with VPATH builds.
+for f in gpg.conf gpg-agent.conf; do
+ if [ -f ./$f ]; then
+ :
+ elif [ -f $srcdir/$f.tmpl ]; then
+ cat $srcdir/$f.tmpl >$f
+ fi
+done
+
+# Always work in the current directory
+GNUPGHOME=`pwd`
+export GNUPGHOME
+
+# We do not use an external info variable for gpg-agent because we use
+# a standard socket in the home directory. This way gpg-agent will be
+# started as soon as needed. It is terminated indirectly using a
+# Makefile rule.
+GPG_AGENT_INFO=
+
+GPG="../../g10/gpg2 --no-permission-warning "
exec 5>&2 2>${pgmname}.log
diff --git a/tests/openpgp/genkey1024.test b/tests/openpgp/genkey1024.test
index 74c036667..835b4c8c6 100755
--- a/tests/openpgp/genkey1024.test
+++ b/tests/openpgp/genkey1024.test
@@ -10,7 +10,7 @@
. $srcdir/defs.inc || exit 3
-../../g10/gpg2 --quiet --batch --debug-quick-random --homedir . --gen-key <<EOF
+$GPG --quiet --batch --debug-quick-random --gen-key <<EOF
Key-Type: DSA
Key-Length: 1024
Subkey-Type: ELG
@@ -24,7 +24,7 @@ Passphrase: abc
EOF
if have_pubkey_algo "RSA"; then
-../../g10/gpg2 --quiet --batch --debug-quick-random --homedir . --gen-key <<EOF
+$GPG --quiet --batch --debug-quick-random --gen-key <<EOF
Key-Type: RSA
Key-Length: 1024
Key-Usage: sign,encrypt