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-ubuntu-bug-1098738-apt-get-source-md5sum | |
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-ubuntu-bug-1098738-apt-get-source-md5sum')
-rwxr-xr-x | test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum index 14e5a20b8..f0a8835a2 100755 --- a/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum +++ b/test/integration/test-ubuntu-bug-1098738-apt-get-source-md5sum @@ -216,32 +216,24 @@ testmismatch() { Need to get 6 B of source archives. Get:1 http://localhost:${APTHTTPPORT} $1 1.0 (dsc) [2 B] Err:1 http://localhost:${APTHTTPPORT} $1 1.0 (dsc) - File is larger than expected (3 > 2). Mirror sync in progress? + File has unexpected size (3 != 2). Mirror sync in progress? Hashes of expected file: - SHA256:943d3bf22ac661fb0f59bc4ff68cc12b04ff17a838dfcc2537008eb9c7f3770a - Filesize:2 [weak] Get:2 http://localhost:${APTHTTPPORT} $1 1.0 (tar) [4 B] Err:2 http://localhost:${APTHTTPPORT} $1 1.0 (tar) - Hash Sum mismatch + File has unexpected size (3 != 4). Mirror sync in progress? Hashes of expected file: - SHA256:90aebae315675cbf04612de4f7d5874850f48e0b8dd82becbeaa47ca93f5ebfb - Filesize:4 [weak] - Hashes of received file: - - SHA256:90aebae315675cbf04612de4f7d5874850f48e0b8dd82becbeaa47ca93f5ebfb - - Filesize:3 [weak] - Last modification reported: $(lastmodification "aptarchive/${1}_1.0.dsc") -E: Failed to fetch http://localhost:${APTHTTPPORT}/${1}_1.0.dsc File is larger than expected (3 > 2). Mirror sync in progress? +E: Failed to fetch http://localhost:${APTHTTPPORT}/${1}_1.0.dsc File has unexpected size (3 != 2). Mirror sync in progress? Hashes of expected file: - SHA256:943d3bf22ac661fb0f59bc4ff68cc12b04ff17a838dfcc2537008eb9c7f3770a - Filesize:2 [weak] -E: Failed to fetch http://localhost:${APTHTTPPORT}/${1}_1.0.tar.gz Hash Sum mismatch +E: Failed to fetch http://localhost:${APTHTTPPORT}/${1}_1.0.tar.gz File has unexpected size (3 != 4). Mirror sync in progress? Hashes of expected file: - SHA256:90aebae315675cbf04612de4f7d5874850f48e0b8dd82becbeaa47ca93f5ebfb - Filesize:4 [weak] - Hashes of received file: - - SHA256:90aebae315675cbf04612de4f7d5874850f48e0b8dd82becbeaa47ca93f5ebfb - - Filesize:3 [weak] - Last modification reported: $(lastmodification "aptarchive/${1}_1.0.dsc") E: Failed to fetch some archives." elif [ "$1" = 'pkg-md5-bad' ]; then FAILURE="Reading package lists... |