File: test-ubuntu-bug-1921626-unsized-packages

package info (click to toggle)
apt 3.1.12
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 22,736 kB
  • sloc: cpp: 71,048; sh: 31,750; xml: 5,553; perl: 217; python: 197; ansic: 191; makefile: 41
file content (40 lines) | stat: -rwxr-xr-x 1,264 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 ..