diff options
Diffstat (limited to 'tests/openpgp')
-rw-r--r-- | tests/openpgp/ChangeLog | 9 | ||||
-rw-r--r-- | tests/openpgp/Makefile.am | 7 | ||||
-rwxr-xr-x | tests/openpgp/defs.inc | 27 | ||||
-rw-r--r-- | tests/openpgp/gpg-agent.conf.tmpl | 2 |
4 files changed, 33 insertions, 12 deletions
diff --git a/tests/openpgp/ChangeLog b/tests/openpgp/ChangeLog index 566b9815a..865f474f1 100644 --- a/tests/openpgp/ChangeLog +++ b/tests/openpgp/ChangeLog @@ -1,3 +1,12 @@ +2010-05-12 Werner Koch <[email protected]> + + * Makefile.am (TESTS_ENVIRONMENT): New. Start all scripts udner + the control of the gpg-agent. + (prepared.stamp): Create gpg-agent.conf. + * defs.inc: Do not create gpg-agent.conf + (GNUPGHOME): Check that it is set properly. + (GPG_AGENT_INFO): Do not change. + 2010-05-11 Werner Koch <[email protected]> * genkey1024.test: Use GPG macro. diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am index aa99c3e9b..461594207 100644 --- a/tests/openpgp/Makefile.am +++ b/tests/openpgp/Makefile.am @@ -23,6 +23,11 @@ GPG_IMPORT = ../../g10/gpg2 --homedir . \ required_pgms = ../../g10/gpg2 ../../agent/gpg-agent \ ../../tools/gpg-connect-agent + +TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= LC_ALL=C \ + ../../agent/gpg-agent --quiet --daemon sh + + TESTS = version.test mds.test \ decrypt.test decrypt-dsa.test \ sigs.test sigs-dsa.test \ @@ -66,8 +71,10 @@ distclean-local: prepared.stamp: ./pubring.gpg ./secring.gpg ./plain-1 ./plain-2 ./plain-3 \ ./pubring.pkr ./secring.skr ./gpg_dearmor $(DATA_FILES) $(GPG_IMPORT) $(srcdir)/pubdemo.asc + cat $(srcdir)/gpg-agent.conf.tmpl > gpg-agent.conf echo timestamp >./prepared.stamp + # We need to depend on a couple of programs so that the tests don't # start before all programs are built. ./gpg_dearmor: $(required_pgms) diff --git a/tests/openpgp/defs.inc b/tests/openpgp/defs.inc index a00aa1372..12e1b808e 100755 --- a/tests/openpgp/defs.inc +++ b/tests/openpgp/defs.inc @@ -1,6 +1,6 @@ # Definitions for the OpenPGP test scripts -*- sh -*- # Copyright 1998,1999,2000,2001,2002,2003,2004,2005,2006, -# 2007 Free Software Foundation, Inc. +# 2007, 2010 Free Software Foundation, Inc. # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. This file is @@ -162,7 +162,7 @@ pgmname=`basename $0` [ -z "$srcdir" ] && fatal "not called from make" # Make sure we have a valid option file even with VPATH builds. -for f in gpg.conf gpg-agent.conf; do +for f in gpg.conf ; do if [ -f ./$f ]; then : elif [ -f $srcdir/$f.tmpl ]; then @@ -170,19 +170,24 @@ for f in gpg.conf gpg-agent.conf; do fi done -# Always work in the current directory -GNUPGHOME=`pwd` -export GNUPGHOME +# Always work in the current directory. We set GNUPGHOME only if it +# has not been set already. Usually it is set through the Makefile's +# TESTS_ENVIRONMENT macro. +if [ -z "$GNUPGHOME" ]; then + GNUPGHOME=`pwd` + export GNUPGHOME +elif [ "$GNUPGHOME" != `pwd` ]; then + echo "$pgmname: GNUPGHOME not set to the cwd" $* >&2 + exit 1 +fi -# 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 +echo "Test: $pgmname" > ${pgmname}.log +echo "GNUPGHOME=$GNUPGHOME" >> ${pgmname}.log +echo "GPG_AGENT_INFO=$GPG_AGENT_INFO" >> ${pgmname}.log +exec 5>&2 2>>${pgmname}.log : # end diff --git a/tests/openpgp/gpg-agent.conf.tmpl b/tests/openpgp/gpg-agent.conf.tmpl index f4889408c..18e15206b 100644 --- a/tests/openpgp/gpg-agent.conf.tmpl +++ b/tests/openpgp/gpg-agent.conf.tmpl @@ -1,2 +1,2 @@ -use-standard-socket +no-use-standard-socket |