]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-update-filesize-mismatch
require $(HASH)-Download field in .diff/Index files
[apt.git] / test / integration / test-apt-update-filesize-mismatch
CommitLineData
23397c9d
DK
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
23397c9d
DK
6setupenvironment
7configarchitecture 'i386'
8configcompression 'gz'
9
10insertpackage 'testing' 'foo' 'all' '1'
11insertpackage 'testing' 'foo2' 'all' '1'
12insertsource 'testing' 'foo' 'all' '1'
13insertsource 'testing' 'foo2' 'all' '1'
14
15setupaptarchive --no-update
16changetowebserver
17
18find aptarchive \( -name 'Packages' -o -name 'Sources' -o -name 'Translation-en' \) -delete
19for release in $(find aptarchive -name 'Release'); do
20 cp "$release" "${release}.backup"
21done
22
23testsuccess aptget update
24testsuccess aptcache show foo
25testsuccess aptget install foo -s
26
27for get in $(sed -n 's#^GET /\([^ ]\+\.gz\) HTTP.\+$#\1#p' aptarchive/webserver.log); do
28 for ext in '' '.gz'; do
29 COMPRESSFILE="$get"
30 get="${get}${ext}"
6e2261d0 31 FILE="$(basename "$get" '.gz')"
23397c9d
DK
32 msgmsg 'Test filesize mismatch with file' "$FILE"
33 rm -rf rootdir/var/lib/apt/lists
34
35 for release in $(find aptarchive -name 'Release'); do
36 SIZE="$(awk "/$FILE\$/ { print \$2; exit }" "${release}.backup")"
37 sed "s# $SIZE # $(($SIZE + 111)) #" "${release}.backup" > "$release"
38 done
39 signreleasefiles
40
9397ea94
MV
41 testfailure aptget update -o Debug::pkgAcquire::Worker=1
42 cp rootdir/tmp/testfailure.output rootdir/tmp/update.output
3261271e 43 testsuccess grep -E "$(basename "$COMPRESSFILE" '.gz').*Hash Sum mismatch" rootdir/tmp/update.output
9397ea94
MV
44 testfailure aptcache show foo
45 testfailure aptget install foo -s
23397c9d
DK
46
47 testfailure aptcache show bar
48 testfailure aptget install bar -s
49 done
50done