summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-update-hashsum-mismatch
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-07-26 18:35:42 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2017-07-26 19:07:56 +0200
commitf2f8e89f08cdf01c83a0b8ab053c65329d85ca90 (patch)
tree7ca9caf3e9dfa5caaad5dda836c0d95278a57204 /test/integration/test-apt-update-hashsum-mismatch
parentd7518dba50e2285c41c7002a1d86f876401fd9ea (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-hashsum-mismatch')
-rwxr-xr-xtest/integration/test-apt-update-hashsum-mismatch11
1 files changed, 3 insertions, 8 deletions
diff --git a/test/integration/test-apt-update-hashsum-mismatch b/test/integration/test-apt-update-hashsum-mismatch
index 4d4c33286..48d041a15 100755
--- a/test/integration/test-apt-update-hashsum-mismatch
+++ b/test/integration/test-apt-update-hashsum-mismatch
@@ -15,12 +15,6 @@ insertsource 'testing' 'foo2' 'all' '1'
setupaptarchive --no-update
changetowebserver
-echo 'Package: bar
-Maintainer: Doctor Evil <evil@example.com>
-Description: come to the dark side
-' > aptarchive/DoctorEvil
-compressfile aptarchive/DoctorEvil
-
find aptarchive \( -name 'Packages' -o -name 'Sources' -o -name 'Translation-en' \) -delete
testsuccess aptget update
@@ -29,9 +23,8 @@ testsuccess aptget install foo -s
for get in $(sed -n 's#^GET /\([^ ]\+\.gz\) HTTP.\+$#\1#p' aptarchive/webserver.log.client*.log); do
msgmsg 'Test hashsum mismatch with file' "$get"
+ breakfiles "aptarchive/${get}"
rm -rf rootdir/var/lib/apt/lists
- webserverconfig 'aptwebserver::overwrite' ''
- webserverconfig "aptwebserver::overwrite::$(printf '%s' "${get}" | sed 's#/#%2F#g' )::filename" '%2FDoctorEvil.gz'
testfailure aptget update
cp rootdir/tmp/testfailure.output rootdir/tmp/update.output
@@ -41,4 +34,6 @@ for get in $(sed -n 's#^GET /\([^ ]\+\.gz\) HTTP.\+$#\1#p' aptarchive/webserver.
testfailure aptcache show bar
testfailure aptget install bar -s
+
+ unbreakfiles "aptarchive/${get}"
done