diff options
author | Werner Koch <wk@gnupg.org> | 2010-05-11 20:00:31 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-05-11 20:00:31 +0200 |
commit | f5551672fb82af31a22e3b649cd270a467dbadd9 (patch) | |
tree | 06eb2551200ea6a353c44b1e2d278479bb277ba1 /tests | |
parent | Fix for bug 1223 (diff) | |
download | gnupg2-f5551672fb82af31a22e3b649cd270a467dbadd9.tar.xz gnupg2-f5551672fb82af31a22e3b649cd270a467dbadd9.zip |
Update tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/openpgp/ChangeLog | 12 | ||||
-rw-r--r-- | tests/openpgp/Makefile.am | 8 | ||||
-rwxr-xr-x | tests/openpgp/defs.inc | 24 | ||||
-rwxr-xr-x | tests/openpgp/genkey1024.test | 4 | ||||
-rw-r--r-- | tests/openpgp/gpg-agent.conf.tmpl | 2 |
5 files changed, 39 insertions, 11 deletions
diff --git a/tests/openpgp/ChangeLog b/tests/openpgp/ChangeLog index 68a9671c9..c3c5aa8f5 100644 --- a/tests/openpgp/ChangeLog +++ b/tests/openpgp/ChangeLog @@ -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 + 2010-05-07 Werner Koch <wk@g10code.com> * import.test: Add test case for bug#1223. @@ -48,7 +58,7 @@ we support. This is safer than the previous setup which could hide that some ciphers weren't being tested. Plus, this automatically tests any new ciphers libgcrypt supports. - (all_hash_algos): New. + (all_hash_algos): New. * sigs.test: Use it here, and also test with >=160 bit hashes for DSA2. * conventional.test, encrypt.test, encrypt-dsa.test, diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am index 9356cb376..fcce0e32a 100644 --- a/tests/openpgp/Makefile.am +++ b/tests/openpgp/Makefile.am @@ -40,16 +40,20 @@ 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 \ bug1223-good.asc bug1223-bogus.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..da7ee3020 100755 --- a/tests/openpgp/defs.inc +++ b/tests/openpgp/defs.inc @@ -162,13 +162,25 @@ 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 +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 --homedir . " +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..b7f9c1987 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 diff --git a/tests/openpgp/gpg-agent.conf.tmpl b/tests/openpgp/gpg-agent.conf.tmpl new file mode 100644 index 000000000..f4889408c --- /dev/null +++ b/tests/openpgp/gpg-agent.conf.tmpl @@ -0,0 +1,2 @@ +use-standard-socket + |