diff options
author | Michael Vogt <mvo@ubuntu.com> | 2014-10-06 17:42:39 +0200 |
---|---|---|
committer | Michael Vogt <mvo@ubuntu.com> | 2014-10-06 17:42:39 +0200 |
commit | a2d40703e4a5590a689ace4466f92e590434944d (patch) | |
tree | 5e878fcc11eb94d96c65940ef3d30e922f217950 /test/integration/test-apt-update-expected-size | |
parent | ffd2dd93a640b47663ebdccc4fda00b426b3db71 (diff) | |
parent | 00a06b8eb82cf930511fc003bd16d7034e5a0cb5 (diff) |
make http size check work
Diffstat (limited to 'test/integration/test-apt-update-expected-size')
-rwxr-xr-x | test/integration/test-apt-update-expected-size | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/integration/test-apt-update-expected-size b/test/integration/test-apt-update-expected-size new file mode 100755 index 000000000..72812336d --- /dev/null +++ b/test/integration/test-apt-update-expected-size @@ -0,0 +1,27 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'apt' 'all' '1.0' + +setupaptarchive --no-update +changetowebserver + +# normal update works fine +testsuccess aptget update + +# append junk at the end of the Packages.gz/Packages +SIZE="$(stat --printf=%s aptarchive/dists/unstable/main/binary-i386/Packages)" +echo "1234567890" >> aptarchive/dists/unstable/main/binary-i386/Packages.gz +echo "1234567890" >> aptarchive/dists/unstable/main/binary-i386/Packages +NEW_SIZE="$(stat --printf=%s aptarchive/dists/unstable/main/binary-i386/Packages)" +rm -f rootdir/var/lib/apt/lists/localhost* +testequal "W: Failed to fetch http://localhost:8080/dists/unstable/main/binary-i386/Packages Writing more data than expected ($NEW_SIZE > $SIZE) [IP: ::1 8080] + +E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq + |