X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/0977f81757f42889a9edb761061529041afe0a06..ed793a19ec00b83254029509bc516e3ba911c75a:/test/integration/test-apt-update-expected-size diff --git a/test/integration/test-apt-update-expected-size b/test/integration/test-apt-update-expected-size index a039e9e1c..045217a77 100755 --- a/test/integration/test-apt-update-expected-size +++ b/test/integration/test-apt-update-expected-size @@ -15,16 +15,16 @@ changetowebserver # normal update works fine testsuccess aptget update -# make InRelease really big +# make InRelease really big to trigger fallback mv aptarchive/dists/unstable/InRelease aptarchive/dists/unstable/InRelease.good dd if=/dev/zero of=aptarchive/dists/unstable/InRelease bs=1M count=2 2>/dev/null touch -d '+1hour' aptarchive/dists/unstable/InRelease -aptget update -o Apt::Get::List-Cleanup=0 -o acquire::MaxReleaseFileSize=$((1*1000*1000)) -o Debug::pkgAcquire::worker=0 > output.log +testsuccess aptget update -o Apt::Get::List-Cleanup=0 -o acquire::MaxReleaseFileSize=$((1*1000*1000)) -o Debug::pkgAcquire::worker=0 msgtest 'Check that the max write warning is triggered' -if grep -q "Writing more data than expected" output.log; then +if grep -q "Writing more data than expected" rootdir/tmp/testsuccess.output; then msgpass else - cat output.log + cat rootdir/tmp/testsuccess.output msgfail fi # ensure the failed InRelease file got renamed @@ -34,11 +34,11 @@ mv aptarchive/dists/unstable/InRelease.good aptarchive/dists/unstable/InRelease # 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 +find aptarchive -name 'Packages*' | while read pkg; do + echo "1234567890" >> "$pkg" +done 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) E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -qq -