summaryrefslogtreecommitdiff
path: root/test/integration/framework
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/framework
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/framework')
-rw-r--r--test/integration/framework14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 12c80b96c..58e56344e 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -2002,6 +2002,20 @@ forallsupportedcompressors() {
done
}
+breakfiles() {
+ while [ -n "$1" ]; do
+ mv -f "${1}" "${1}.bak"
+ testsuccess dd if=/dev/zero of="${1}" bs="$(stat -c %s "${1}.bak")" count=1
+ shift
+ done
+}
+unbreakfiles() {
+ while [ -n "$1" ]; do
+ mv -f "${1}.bak" "${1}"
+ shift
+ done
+}
+
### convenience hacks ###
mkdir() {
# creating some directories by hand is a tedious task, so make it look simple