summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2025-01-22 09:34:37 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2025-01-22 09:55:11 +0100
commit09c76cb29b61e1d523a30287f8a9bf0cb0b608e7 (patch)
tree9414ac9ba3395e04a55c1ebb99405f36e48ed500 /test/integration
parent61f8f40f921cde13c5b97abbdf900646745e8e30 (diff)
sqv, gpgv: Do not fail if Dir::Etc::Trusted is set and trusted.gpg.d is missing
This should remain a warning case for now. So push the errors to a stack and see if we can find any file. Explictly warn again if Dir::Etc::trusted is set, as it is like _super_ deprecated. Reported-By: Cyril Brulebois <kibi@debian.org> in Bug#1032131
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-method-gpgv-legacy-keyring48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/integration/test-method-gpgv-legacy-keyring b/test/integration/test-method-gpgv-legacy-keyring
new file mode 100755
index 000000000..55ad2463d
--- /dev/null
+++ b/test/integration/test-method-gpgv-legacy-keyring
@@ -0,0 +1,48 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture "amd64"
+
+insertpackage 'testing' 'foo' 'all' '1'
+
+buildaptarchive
+setupaptarchive --no-update
+changetowebserver
+
+alias inrelease_size="stat -c %s aptarchive/dists/testing/InRelease"
+
+testsuccessequal "Get:1 http://localhost:${APTHTTPPORT} testing InRelease [$(inrelease_size) B]
+Get:2 http://localhost:${APTHTTPPORT} testing/main all Packages [248 B]
+Get:3 http://localhost:${APTHTTPPORT} testing/main Translation-en [225 B]
+Reading package lists..." aptget update -q
+
+mv rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg rootdir/etc/apt/trusted.gpg
+
+if test -e "${METHODSDIR}/sqv"; then
+ missing_key="The signatures couldn't be verified because no keyring is specified"
+else
+ missing_key="The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A90D141DBAC8DAE"
+fi
+
+testwarningequal "Hit:1 http://localhost:${APTHTTPPORT} testing InRelease
+Reading package lists...
+W: http://localhost:${APTHTTPPORT}/dists/testing/InRelease: Loading ${TMPWORKINGDIRECTORY}/rootdir/etc/apt/trusted.gpg from deprecated option Dir::Etc::Trusted" aptget update -q -o Dir::Etc::trusted=trusted.gpg
+
+testwarningequal "Hit:1 http://localhost:${APTHTTPPORT} testing InRelease
+Err:1 http://localhost:${APTHTTPPORT} testing InRelease
+ $missing_key
+Reading package lists...
+W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://localhost:${APTHTTPPORT} testing InRelease: $missing_key
+W: Failed to fetch http://localhost:${APTHTTPPORT}/dists/testing/InRelease $missing_key
+W: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -q
+
+rmdir rootdir/etc/apt/trusted.gpg.d
+
+testwarningequal "Hit:1 http://localhost:${APTHTTPPORT} testing InRelease
+Reading package lists...
+W: http://localhost:${APTHTTPPORT}/dists/testing/InRelease: Loading ${TMPWORKINGDIRECTORY}/rootdir/etc/apt/trusted.gpg from deprecated option Dir::Etc::Trusted" aptget update -q -o Dir::Etc::trusted=trusted.gpg
+