diff options
Diffstat (limited to 'tests/openpgp/version.test')
-rwxr-xr-x | tests/openpgp/version.test | 93 |
1 files changed, 91 insertions, 2 deletions
diff --git a/tests/openpgp/version.test b/tests/openpgp/version.test index 34733e27d..ed0f6c449 100755 --- a/tests/openpgp/version.test +++ b/tests/openpgp/version.test @@ -10,8 +10,97 @@ . $srcdir/defs.inc || exit 3 -# print the GPG version +# This is the first test run by "make check". First kill a possible +# gpg-agent process from a previous test run. +if $GPG_AGENT --quiet; then + echo "$pgmname: killing leftover gpg-agent process" >&2 + $GPG_CONNECT_AGENT killagent /bye >/dev/null + sleep 2 +fi + + +info "Deleting old files" +if [ -f Makefile -a -f $srcdir/decrypt-dsa.test ]; then + : +else + fatal "not running in the test directory" + exit 1 +fi +if [ -d private-keys-v1.d ]; then + rm private-keys-v1.d/* 2>/dev/null || true + rmdir private-keys-v1.d +fi +for i in pubring.gpg pubring.gpg~ trustdb.gpg trustdb.gpg~ ; do + [ -d "$i" ] && rm "$i" +done + +# Now start the agent right away, so that there is only one place +# where starting the agent may fail. To speed up key generation we +# create a faked random seed file. Note that we need to set the +# agent-program so that gpg-connect-agent is able to start the agent +# we are currently testing and not an already installed one. +info "Starting the agent" +$MKTDATA 600 >random_seed +if $GPG_CONNECT_AGENT -v --agent-program="$GPG_AGENT" /bye; then + : +else + error "starting the gpg-agent failed" + exit 1 +fi + + +info "Creating sample data files" +for i in 500 9000 32000 80000; do + $MKTDATA $i >data-$i +done +cat $srcdir/../../doc/HACKING \ + $srcdir/../../doc/DETAILS \ + $srcdir/../../doc/gpg.texi >plain-large + +info "Unpacking samples" +$GPG --dearmor < $srcdir/plain-1o.asc > ./plain-1 +$GPG --dearmor < $srcdir/plain-2o.asc > ./plain-2 +$GPG --dearmor < $srcdir/plain-3o.asc > ./plain-3 + +info "Storing private keys" +for i in 50B2D4FA4122C212611048BC5FC31BD44393626E \ + 7E201E28B6FEB2927B321F443205F4724EBE637E \ + 13FDB8809B17C5547779F9D205C45F47CE0217CE \ + 343D8AF79796EE107D645A2787A9D9252F924E6F \ + 8B5ABF3EF9EB8D96B91A0B8C2C4401C91C834C34 \ + 0D6F6AD4C4C803B25470F9104E9F4E6A4CA64255 \ + FD692BD59D6640A84C8422573D469F84F3B98E53 \ + 76F7E2B35832976B50A27A282D9B87E44577EB66 \ + A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD ; do + $GPG --dearmor < $srcdir/privkeys/$i.asc > private-keys-v1.d/$i.key +done + +info "Importing public demo and test keys" +$GPG --yes --import $srcdir/pubdemo.asc $srcdir/pubring.asc +$GPG --dearmor < $srcdir/pubring.pkr.asc | $GPG --yes --import + + +info "Preset passphrases" +$GPG_PRESET_PASSPHRASE --preset -P def 50B2D4FA4122C212611048BC5FC31BD44393626E +$GPG_PRESET_PASSPHRASE --preset -P def 7E201E28B6FEB2927B321F443205F4724EBE637E +$GPG_PRESET_PASSPHRASE --preset -P abc 76F7E2B35832976B50A27A282D9B87E44577EB66 +$GPG_PRESET_PASSPHRASE --preset -P abc A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD + + +# Note: secring.asc and secring.skr.asc are the original secrings for +# our test files. We don't support this as storage format anymore but +# keep the files here for reference. The actual keys have been +# extracted and put in gpg-agent's format unter privkeys/. Because +# the current gpg's import feature does not support storing of +# unprotected keys in the new gpg-agent format, we had to resort to +# some trickery to convert them. + + +info "Printing the GPG version" $GPG --version -#fixme: check that the output is correct +#fixme: check that the output is as expected + |