summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2021-04-09 18:16:10 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2021-04-13 16:00:41 +0200
commit1412cf51403286e9c040f9f86fd4d8306e62aff2 (patch)
tree723c7b1f1314ab0a2331af56f48587b008d50616 /test
parent27a4fb3a9ac67a13ed516c75feefdc1fd426520a (diff)
Error on packages without a Size field (option Acquire::AllowUnsizedPackages)
Repositories without Size information for packages are not proper and need fixing. This ensures people see an error in CI, and get notifications and hence the ability to fix it. It can be turned off by setting Acquire::AllowUnsizedPackages to true.
Diffstat (limited to 'test')
-rw-r--r--test/integration/framework4
-rwxr-xr-xtest/integration/test-ubuntu-bug-1921626-unsized-packages5
2 files changed, 9 insertions, 0 deletions
diff --git a/test/integration/framework b/test/integration/framework
index cfde80329..412a96577 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -486,6 +486,10 @@ EOF
echo 'APT::Machine-ID "912e43bd1c1d4ba481f9f8ccab25f9ee";' > rootdir/etc/apt/apt.conf.d/machine-id
+ # XXX: We really ought to make the packages in the test suite all have Size fields.
+ # But this needs a lot more changes, so let's keep it simple for stable updates.
+ echo 'Acquire::AllowUnsizedPackages "true";' >> rootdir/etc/apt/apt.conf.d/temporary-allow-unsized-packages
+
configcompression '.' 'gz' #'bz2' 'lzma' 'xz'
confighashes 'SHA256' # these are tests, not security best-practices
diff --git a/test/integration/test-ubuntu-bug-1921626-unsized-packages b/test/integration/test-ubuntu-bug-1921626-unsized-packages
index 5442124aa..361cccd2e 100755
--- a/test/integration/test-ubuntu-bug-1921626-unsized-packages
+++ b/test/integration/test-ubuntu-bug-1921626-unsized-packages
@@ -20,6 +20,8 @@ changetowebserver
# Disable sandbox
echo 'APT::Sandbox::User "root";' > rootdir/etc/apt/apt.conf.d/no-acquire-sandbox
+# XXX: Remove temporary hack
+rm rootdir/etc/apt/apt.conf.d/temporary-allow-unsized-packages
testsuccess apt update
@@ -36,3 +38,6 @@ size_c=$(wc -c aptarchive/pool/c_1.0_all.deb | awk '{print $1}')
testsuccessequal "Get:1 http://localhost:${APTHTTPPORT} stable/main all a all 1.0 [$size_a B]
Get:2 http://localhost:${APTHTTPPORT} stable/main all b all 1.0 [$size_b B]
Get:3 http://localhost:${APTHTTPPORT} stable/main all c all 1.0 [$size_c B]" apt download a b c -o Acquire::AllowUnsizedPackages=true
+
+rm *.deb
+testfailureequal "E: Repository is broken: b:i386 (= 1.0) has no Size information" apt download a b c