]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-partial-file-support
activate AI_IDN by default to support IDN domains
[apt.git] / test / integration / test-partial-file-support
index b6b305d25289d41f6b266898263b17862256d107..5b05b277e42dabce83070dbdcfff1c00a4687866 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'
@@ -126,18 +132,17 @@ testrun() {
        testwebserverlaststatuscode '200' "$DOWNLOADLOG"
 }
 
-msgmsg 'http: Test with Content-Length'
-webserverconfig 'aptwebserver::chunked-transfer-encoding' 'false'
-testrun 'http://localhost:8080'
-msgmsg 'http: Test with Transfer-Encoding: chunked'
-webserverconfig 'aptwebserver::chunked-transfer-encoding' 'true'
-testrun 'http://localhost:8080'
+serverconfigs() {
+       msgmsg "${1%%:*}: Test with Content-Length"
+       webserverconfig 'aptwebserver::chunked-transfer-encoding' 'false'
+       testrun "$1"
+       msgmsg "${1%%:*}: Test with Transfer-Encoding: chunked"
+       webserverconfig 'aptwebserver::chunked-transfer-encoding' 'true'
+       testrun "$1"
+}
+
+serverconfigs "http://localhost:${APTHTTPPORT}"
 
 changetohttpswebserver
 
-msgmsg 'https: Test with Content-Length'
-webserverconfig 'aptwebserver::chunked-transfer-encoding' 'false'
-testrun 'https://localhost:4433'
-msgmsg 'https: Test with Transfer-Encoding: chunked'
-webserverconfig 'aptwebserver::chunked-transfer-encoding' 'true'
-testrun 'https://localhost:4433'
+serverconfigs "https://localhost:${APTHTTPSPORT}"