summaryrefslogtreecommitdiff
path: root/test/integration/test-releasefile-verification
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2024-11-22 16:20:05 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2024-11-22 16:44:02 +0100
commite983d98c4fcd952ffcbc010b185455913c8af650 (patch)
treef5d7a1af28a1d137fa76821c84fa4cdab8bd0f17 /test/integration/test-releasefile-verification
parentde3f663d823f9c185514af69296d011e22161479 (diff)
test: Ensure we test both gpgv-g10code and gpgv-sq
Diffstat (limited to 'test/integration/test-releasefile-verification')
-rwxr-xr-xtest/integration/test-releasefile-verification18
1 files changed, 14 insertions, 4 deletions
diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification
index fcd5d987c..0109f2954 100755
--- a/test/integration/test-releasefile-verification
+++ b/test/integration/test-releasefile-verification
@@ -101,6 +101,16 @@ updatewithwarnings() {
testsuccess grep -E "$1" rootdir/tmp/testwarning.output
}
+foreachgpg() {
+ rm -f rootdir/etc/apt/apt.conf.d/00gpgvcmd
+ "$@"
+ for GPGV in "gpgv-sq" "gpgv-g10code"; do
+ msgmsg "Forcing $GPGV to be used"
+ echo "APT::Key::GPGVCommand \"$GPGV\";" > "rootdir/etc/apt/apt.conf.d/00gpgvcmd"
+ "$@"
+ done
+}
+
runtest() {
msgmsg 'Cold archive signed by' 'Joe Sixpack'
prepare "${PKGFILE}"
@@ -480,7 +490,7 @@ successfulaptgetupdate() {
testsuccess grep "$1" aptupdate.output
fi
}
-runtest3 'Trusted'
+foreachgpg runtest3 'Trusted'
successfulaptgetupdate() {
testwarning aptget update -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::gpgv=1
@@ -489,7 +499,7 @@ successfulaptgetupdate() {
fi
testsuccess grep 'uses weak algorithm' rootdir/tmp/testwarning.output
}
-runtest3 'Weak'
+foreachgpg runtest3 'Weak'
msgmsg "Running test with apt-untrusted digest"
echo "APT::Hashes::$APT_TESTS_DIGEST_ALGO::Untrusted \"yes\";" > rootdir/etc/apt/apt.conf.d/truststate
@@ -524,8 +534,8 @@ runfailure() {
export APT_DONT_SIGN='Release.gpg'
done
}
-runfailure
+foreachgpg runfailure
msgmsg "Running test with gpgv-untrusted digest"
export APT_TESTS_DIGEST_ALGO='MD5'
-runfailure
+foreachgpg runfailure