From afd7a175b53248d68095cecf5616705d093ffbc9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:14:08 +0200 Subject: Adding debian version 2.2.40-1.1. Signed-off-by: Daniel Baumann --- debian/tests/control | 12 ++++++++++++ debian/tests/gpgv-win32 | 34 ++++++++++++++++++++++++++++++++++ debian/tests/migration | 22 ++++++++++++++++++++++ debian/tests/simple-tests | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+) create mode 100644 debian/tests/control create mode 100755 debian/tests/gpgv-win32 create mode 100755 debian/tests/migration create mode 100644 debian/tests/simple-tests (limited to 'debian/tests') diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..9609918 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,12 @@ +Tests: gpgv-win32 +Depends: gpgv-win32, gnupg2, gpgv2, wine32, diffutils +Restrictions: allow-stderr +Architecture: i386 + +Tests: simple-tests +Depends: gnupg2, gpgv2 +Restrictions: allow-stderr + +Tests: migration +Depends: gpg, gnupg1, gnupg-utils, debian-archive-keyring, diffutils +Restrictions: allow-stderr diff --git a/debian/tests/gpgv-win32 b/debian/tests/gpgv-win32 new file mode 100755 index 0000000..035c060 --- /dev/null +++ b/debian/tests/gpgv-win32 @@ -0,0 +1,34 @@ +#!/bin/bash + +set -e + +export GNUPGHOME=$(mktemp -d) +gpgargs=(--batch --quiet --pinentry-mode=loopback --passphrase '' --with-colons) + +# Generate a minimal signing key: +gpg "${gpgargs[@]}" --quick-gen-key 'Test key for gpgv-win32 ' + +gpg "${gpgargs[@]}" -o "$GNUPGHOME/key.gpg" --export test-key@example.com + +# Sign this very script +rm -f "${0}.gpg" +gpg "${gpgargs[@]}" --output "${0}.gpg" --detach-sign "${0}" + +# Verify using gpgv +gpgv --quiet --status-fd 3 3> native.status --keyring "$GNUPGHOME/key.gpg" "${0}.gpg" "${0}" + +WINE=/usr/lib/wine/wine +export WINESERVER=/usr/lib/wine/wineserver32 + +# Verify using gpgv.exe (using --status-fd 1 because i don't know how +# to pass a non-standard file descriptor into wine) +"$WINE" /usr/share/win32/gpgv.exe --quiet --status-fd 1 > win32.status --keyring "Z://${GNUPGHOME}/key.gpg" "${0}.gpg" "${0}" + +# convert to unix newlines if necessary: +sed -i 's/\r$//' win32.status + +diff -u native.status win32.status + +head -v win32.status + +rm -rf "$GNUPGHOME" diff --git a/debian/tests/migration b/debian/tests/migration new file mode 100755 index 0000000..2179e65 --- /dev/null +++ b/debian/tests/migration @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e +set -x + +DIR=$(mktemp -d) +GPG_HOME="$DIR/gnupg" +gpg=(gpg --homedir "$GPG_HOME" --batch --quiet --with-colons) +gpg1=(gpg1 --homedir "$GPG_HOME" --batch --quiet --with-colons) + +mkdir "$GPG_HOME" +chmod 700 "$GPG_HOME" + +cat $(ls /usr/share/keyrings/debian-archive-*.gpg \ + | grep -vE 'debian-archive-bookworm-stable.gpg|debian-archive-keyring.gpg') \ + | "${gpg1[@]}" --import +"${gpg1[@]}" --list-keys +"${gpg[@]}" --list-keys > "$DIR/key.list.before" +migrate-pubring-from-classic-gpg "$GPG_HOME" +"${gpg[@]}" --list-keys > "$DIR/key.list.after" + +diff -u "$DIR/key.list.before" "$DIR/key.list.after" diff --git a/debian/tests/simple-tests b/debian/tests/simple-tests new file mode 100644 index 0000000..97d4ab4 --- /dev/null +++ b/debian/tests/simple-tests @@ -0,0 +1,34 @@ +#!/bin/sh + +set -e +set -x + +DIR=$(mktemp -d) +GPG_HOME=$DIR/gnupg +gpg="gpg --homedir $GPG_HOME" + +mkdir $GPG_HOME +chmod 700 $GPG_HOME + +#trap "cd $HOME && rm -rf $DIR" EXIT + +cd $DIR + +cat > key-batch << EOF +Key-Type: default +Subkey-Type: default +Name-Real: test case +Name-Email: example@example.com +Expire-Date: 0 +%no-protection +%commit +EOF + +$gpg --batch --generate-key key-batch +$gpg -abs < $GPG_HOME/pubring.kbx > pubring.kbx.asc +$gpg --verify pubring.kbx.asc $GPG_HOME/pubring.kbx +gpgv --keyring $GPG_HOME/pubring.kbx pubring.kbx.asc $GPG_HOME/pubring.kbx + +# Encrypt +$gpg -e -r example@example.com < $GPG_HOME/pubring.kbx > pubring.kbx.gpg +$gpg -d -r example@example.com < pubring.kbx.gpg > pubring.kbx.gpg.dec -- cgit v1.2.3