aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--agent/ChangeLog4
-rw-r--r--agent/gpg-agent.c7
-rw-r--r--tests/Makefile.am4
-rwxr-xr-xtests/inittests2
-rw-r--r--tests/openpgp/ChangeLog9
-rw-r--r--tests/openpgp/Makefile.am7
-rwxr-xr-xtests/openpgp/defs.inc27
-rw-r--r--tests/openpgp/gpg-agent.conf.tmpl2
8 files changed, 45 insertions, 17 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index d17f7e2df..5c3143c71 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-12 Werner Koch <[email protected]>
+
+ * gpg-agent.c (handle_tick): Do not print die message with option -q.
+
2010-05-11 Werner Koch <[email protected]>
* agent.h (opt): Add field USE_STANDARD_SOCKET.
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index a96108012..1aa706d24 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1660,8 +1660,11 @@ handle_tick (void)
if (kill (parent_pid, 0))
{
shutdown_pending = 2;
- log_info ("parent process died - shutting down\n");
- log_info ("%s %s stopped\n", strusage(11), strusage(13) );
+ if (!opt.quiet)
+ {
+ log_info ("parent process died - shutting down\n");
+ log_info ("%s %s stopped\n", strusage(11), strusage(13) );
+ }
cleanup ();
agent_exit (0);
}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7c231ff6e..512d9d782 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -46,9 +46,9 @@ EXTRA_DIST = runtest inittests $(testscripts) \
samplekeys/cert_g10code_test1.pem \
samplekeys/cert_g10code_theo1.pem
-# We used to run $(testscripts) here but tehse asschk scripts ares not
+# We used to run $(testscripts) here but these asschk scripts are not
# completely reliable in all enviromnets and thus we better disable
-# them. The tests are anyway way to minimal. We will eventually
+# them. The tests are anyway way too minimal. We will eventually
# write new tests based on gpg-connect-agent which has a full fledged
# script language and thus makes it far easier to write tests than to
# use the low--level asschk stuff.
diff --git a/tests/inittests b/tests/inittests
index 1a51bdfc5..790b92eac 100755
--- a/tests/inittests
+++ b/tests/inittests
@@ -73,7 +73,7 @@ for i in ${private_keys}; do
done
# Create the configuration scripts
-# Note, die to an expired test certificate, we need to use
+# Note, due to an expired test certificate, we need to use
# the faked system time option.
cat > gpgsm.conf <<EOF
no-secmem-warning
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