1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Allow to run the test without a running agent.

Add new gpg-agent commands.
This commit is contained in:
Werner Koch 2010-05-11 17:52:00 +00:00
parent bf761927c9
commit ce9be10163
11 changed files with 102 additions and 38 deletions

View file

@ -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

View file

@ -1,3 +1,13 @@
2010-05-11 Werner Koch <wk@g10code.com>
* 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 <wk@g10code.com>
* Makefile.am (required_pgms): New.

View file

@ -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

View file

@ -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
# 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
GPG="../../g10/gpg2 --no-permission-warning --homedir . "
# 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

View file

@ -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