]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-update-expected-size
make expected-size a maximum-size check as this is what we want at this point
[apt.git] / test / integration / test-apt-update-expected-size
CommitLineData
a2d40703
MV
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture "i386"
9
10insertpackage 'unstable' 'apt' 'all' '1.0'
11
12setupaptarchive --no-update
13changetowebserver
14
15# normal update works fine
16testsuccess aptget update
17
c48eea97
MV
18# make InRelease really big
19mv aptarchive/dists/unstable/InRelease aptarchive/dists/unstable/InRelease.good
20dd if=/dev/zero of=aptarchive/dists/unstable/InRelease bs=1M count=2
21touch -d '+1hour' aptarchive/dists/unstable/InRelease
22aptget update -o acquire::MaxReleaseFileSize=$((1*1000*1000))
23
24
a2d40703
MV
25# append junk at the end of the Packages.gz/Packages
26SIZE="$(stat --printf=%s aptarchive/dists/unstable/main/binary-i386/Packages)"
27echo "1234567890" >> aptarchive/dists/unstable/main/binary-i386/Packages.gz
28echo "1234567890" >> aptarchive/dists/unstable/main/binary-i386/Packages
29NEW_SIZE="$(stat --printf=%s aptarchive/dists/unstable/main/binary-i386/Packages)"
30rm -f rootdir/var/lib/apt/lists/localhost*
31testequal "W: Failed to fetch http://localhost:8080/dists/unstable/main/binary-i386/Packages Writing more data than expected ($NEW_SIZE > $SIZE) [IP: ::1 8080]
32
33E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq
34