summaryrefslogtreecommitdiffstats
path: root/debian/tests/migration
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests/migration')
-rwxr-xr-xdebian/tests/migration22
1 files changed, 22 insertions, 0 deletions
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"