summaryrefslogtreecommitdiff
path: root/test/integration/test-http-if-range
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/test-http-if-range')
-rwxr-xr-xtest/integration/test-http-if-range15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/integration/test-http-if-range b/test/integration/test-http-if-range
index ca9f3b2e6..462d731cf 100755
--- a/test/integration/test-http-if-range
+++ b/test/integration/test-http-if-range
@@ -31,7 +31,11 @@ validpartialfile() {
head -n 5 "$TESTFILE" > "$DOWNFILE"
touch -d "$(stat --format '%y' "${TESTFILE}")" "$DOWNFILE"
}
-badpartialfile() {
+badolderpartialfile() {
+ head -n 5 "$TESTFILE" > "$DOWNFILE"
+ touch -d "$(stat --format '%y' "${TESTFILE}") - 1sec" "$DOWNFILE"
+}
+badnewerpartialfile() {
head -n 5 "$TESTFILE" > "$DOWNFILE"
touch -d 'now + 1hour' "$DOWNFILE"
}
@@ -52,8 +56,13 @@ testrun() {
testwebserverlaststatuscode "$3" "$DOWNLOADLOG"
testsuccess cmp "$TESTFILE" "$DOWNFILE"
- badpartialfile
- testdownloadfile "bad partial file $1"
+ badolderpartialfile
+ testdownloadfile "bad old partial file $1"
+ testwebserverlaststatuscode "$4" "$DOWNLOADLOG"
+ testsuccess cmp "$TESTFILE" "$DOWNFILE"
+
+ badnewerpartialfile
+ testdownloadfile "bad new partial file $1"
testwebserverlaststatuscode "$4" "$DOWNLOADLOG"
testsuccess cmp "$TESTFILE" "$DOWNFILE"