]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-partial-file-support
detect 416 complete file in partial by expected hash
[apt.git] / test / integration / test-partial-file-support
index 85046b3eb92616369d45ace64cf5c671ebda0988..c07af7bd0f39484371cb14f513abdbd18b53a534 100755 (executable)
@@ -17,8 +17,8 @@ DOWNLOADLOG='rootdir/tmp/testdownloadfile.log'
 
 testdownloadfile() {
        rm -f "$DOWNLOADLOG"
-       msgtest "Testing download of file $2 with" "$1"
-       if ! downloadfile "$2" "$3" > "$DOWNLOADLOG"; then
+       msgtest "Testing download of file $2 with" "$1 $5"
+       if ! downloadfile "$2" "$3" "$5" > "$DOWNLOADLOG"; then
                cat >&2 "$DOWNLOADLOG"
                msgfail
        else
@@ -78,6 +78,12 @@ followuprequest() {
        testdownloadfile 'completely downloaded file' "${1}/testfile" "$DOWN" '='
        testwebserverlaststatuscode '416' "$DOWNLOADLOG"
 
+       webserverconfig 'aptwebserver::support::content-range' 'false'
+       copysource $TESTFILE 1M $DOWN
+       testdownloadfile 'completely downloaded file' "${1}/testfile" "$DOWN" '=' "SHA1:$(sha1sum "$TESTFILE" | cut -d' ' -f 1)"
+       testwebserverlaststatuscode '416' "$DOWNLOADLOG"
+       webserverconfig 'aptwebserver::support::content-range' 'true'
+
        copysource $TESTFILE 1M $DOWN
        copysource "${TESTFILE}2" 20 "${DOWN}2"
        msgtest 'Testing download of files with' 'completely downloaded file + partial file'