+ webserverconfig 'aptwebserver::response-header::Accept-Ranges' 'bytes'
+ local DOWN='./downloaded/testfile'
+
+ copysource $TESTFILE 0 $DOWN
+ testdownloadfile 'no data' "${1}/testfile" "$DOWN" '='
+ testwebserverlaststatuscode '200' "$DOWNLOADLOG"
+
+ copysource $TESTFILE 20 $DOWN
+ testdownloadfile 'valid partial data' "${1}/testfile" "$DOWN" '='
+ testwebserverlaststatuscode '206' "$DOWNLOADLOG"
+
+ copysource /dev/zero 20 $DOWN
+ testdownloadfile 'invalid partial data' "${1}/testfile" "$DOWN" '!='
+ testwebserverlaststatuscode '206' "$DOWNLOADLOG"
+
+ webserverconfig 'aptwebserver::closeOnError' 'false'
+ followuprequest "$1"
+ webserverconfig 'aptwebserver::closeOnError' 'true'
+ followuprequest "$1"
+ webserverconfig 'aptwebserver::closeOnError' 'false'
+
+ copysource /dev/zero 1M $DOWN
+ testdownloadfile 'too-big partial file' "${1}/testfile" "$DOWN" '='
+ testwebserverlaststatuscode '200' "$DOWNLOADLOG"
+
+ copysource /dev/zero 20 $DOWN
+ touch $DOWN
+ testdownloadfile 'old data' "${1}/testfile" "$DOWN" '='
+ testwebserverlaststatuscode '200' "$DOWNLOADLOG"
+
+ if [ "${1%%:*}" = 'https' ] && expr match "$1" "^.*/redirectme$" >/dev/null; then
+ webserverconfig 'aptwebserver::response-header::Accept-Ranges' 'none'
+ else
+ webserverconfig 'aptwebserver::support::range' 'false'
+ fi