diff options
author | David Kalnischkies <david@kalnischkies.de> | 2017-07-26 18:35:42 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2017-07-26 19:07:56 +0200 |
commit | f2f8e89f08cdf01c83a0b8ab053c65329d85ca90 (patch) | |
tree | 7ca9caf3e9dfa5caaad5dda836c0d95278a57204 /test/integration/test-apt-update-filesize-mismatch | |
parent | d7518dba50e2285c41c7002a1d86f876401fd9ea (diff) |
fail early in http if server answer is too small as well
Failing on too much data is good, but we can do better by checking for
exact filesizes as we know with hashsums how large a file should be, so
if we get a file which has a size we do not expect we can drop it
directly, regardless of if the file is larger or smaller than what we
expect which should catch most cases which would end up as hashsum
errors later now a lot sooner.
Diffstat (limited to 'test/integration/test-apt-update-filesize-mismatch')
-rwxr-xr-x | test/integration/test-apt-update-filesize-mismatch | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/integration/test-apt-update-filesize-mismatch b/test/integration/test-apt-update-filesize-mismatch index 9467e77b6..26b670d8f 100755 --- a/test/integration/test-apt-update-filesize-mismatch +++ b/test/integration/test-apt-update-filesize-mismatch @@ -40,7 +40,11 @@ for get in $(sed -n 's#^GET /\([^ ]\+\.gz\) HTTP.\+$#\1#p' aptarchive/webserver. testfailure aptget update -o Debug::pkgAcquire::Worker=1 cp rootdir/tmp/testfailure.output rootdir/tmp/update.output - testsuccess grep -E "$(basename "$COMPRESSFILE" '.gz').*Hash Sum mismatch" rootdir/tmp/update.output + if [ -z "$ext" ]; then + testsuccess grep -E "$(basename "$COMPRESSFILE" '.gz').*Hash Sum mismatch" rootdir/tmp/update.output + else + testsuccess grep -E "$(basename "$COMPRESSFILE" '.gz').*File has unexpected size" rootdir/tmp/update.output + fi testfailure aptcache show foo testfailure aptget install foo -s |