summaryrefslogtreecommitdiffstats
path: root/test/integration/test-ubuntu-bug-1921626-unsized-packages
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
commit851b6a097165af4d51c0db01b5e05256e5006896 (patch)
tree5f7c388ec894a7806c49a99f3bdb605d0b299a7c /test/integration/test-ubuntu-bug-1921626-unsized-packages
parentInitial commit. (diff)
downloadapt-851b6a097165af4d51c0db01b5e05256e5006896.tar.xz
apt-851b6a097165af4d51c0db01b5e05256e5006896.zip
Adding upstream version 2.6.1.upstream/2.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/test-ubuntu-bug-1921626-unsized-packages')
-rwxr-xr-xtest/integration/test-ubuntu-bug-1921626-unsized-packages40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/integration/test-ubuntu-bug-1921626-unsized-packages b/test/integration/test-ubuntu-bug-1921626-unsized-packages
new file mode 100755
index 0000000..477ed52
--- /dev/null
+++ b/test/integration/test-ubuntu-bug-1921626-unsized-packages
@@ -0,0 +1,40 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture "i386"
+confighashes 'SHA512'
+
+mkdir tree
+head -c $((5*1024)) /dev/urandom > tree/data-file
+
+buildsimplenativepackage 'a' 'all' '1.0' 'stable'
+buildsimplenativepackage 'b' 'all' '1.0' 'stable' '' '' '' '' "$PWD/tree"
+buildsimplenativepackage 'c' 'all' '1.0' 'stable'
+
+setupaptarchive --no-update
+changetowebserver
+
+testsuccess apt update
+
+for file in rootdir/var/lib/apt/lists/*Packages; do
+ awk '!(/^Size/ && ++cnt==2)' $file > $file.new
+ mv $file.new $file
+done
+
+
+size_a=$(wc -c aptarchive/pool/a_1.0_all.deb | awk '{print $1}')
+size_b=$(wc -c aptarchive/pool/b_1.0_all.deb | awk '{print $1}')
+size_c=$(wc -c aptarchive/pool/c_1.0_all.deb | awk '{print $1}')
+
+cd downloaded
+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: http://localhost:${APTHTTPPORT} stable/main all b all 1.0 has no Size information" apt download a b c
+cd ..