X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/63c7141275c8c5c0f6e60f5242785e50cabaf2a0..4f242a2289cc5db7a53afdb875291c94de64fd90:/test/integration/test-acquire-same-file-multiple-times diff --git a/test/integration/test-acquire-same-file-multiple-times b/test/integration/test-acquire-same-file-multiple-times index 255a71a33..a6825b2c2 100755 --- a/test/integration/test-acquire-same-file-multiple-times +++ b/test/integration/test-acquire-same-file-multiple-times @@ -1,7 +1,7 @@ #!/bin/sh set -e -TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment configarchitecture 'amd64' @@ -12,7 +12,8 @@ APTARCHIVE="$(readlink -f ./aptarchive)" filedown() { msgtest 'Downloading the same URI twice over file' "$1" - testsuccess --nomsg apthelper download-file "file:///$APTARCHIVE/foo" ./downloaded/foo1 '' "file:///$APTARCHIVE/foo" ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1 + testsuccess --nomsg apthelper download-file "file:///$APTARCHIVE/foo" './downloaded/foo1' '' \ + "file:///$APTARCHIVE/foo" './downloaded/foo2' '' -o Debug::pkgAcquire::Worker=1 cp rootdir/tmp/testsuccess.output download.log testsuccess cmp "$TESTFILE" ./downloaded/foo1 testsuccess cmp ./downloaded/foo1 ./downloaded/foo2 @@ -44,7 +45,8 @@ changetowebserver -o aptwebserver::redirect::replace::/foo2=/foo httpdown() { msgtest 'Downloading the same URI to different files' 'twice over http' - testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo1 '' http://localhost:8080/foo ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::http=1 + testsuccess --nomsg apthelper download-file "http://localhost:${APTHTTPPORT}/foo" "./downloaded/foo1" '' \ + "http://localhost:${APTHTTPPORT}/foo" './downloaded/foo2' '' -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::http=1 cp rootdir/tmp/testsuccess.output download.log testsuccess cmp "$TESTDIR/framework" ./downloaded/foo1 testsuccess cmp ./downloaded/foo1 ./downloaded/foo2 @@ -56,10 +58,18 @@ testrun 'httpdown' httpredirectdown() { msgtest 'Redirect leads' 'first URI to the second URI' - testsuccess --nomsg apthelper download-file http://localhost:8080/foo2 ./downloaded/foo1 '' http://localhost:8080/foo ./downloaded/foo2 '' -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::http=1 - cp rootdir/tmp/testsuccess.output download.log - testsuccess cmp "$TESTDIR/framework" ./downloaded/foo1 - testsuccess cmp ./downloaded/foo1 ./downloaded/foo2 + for i in 1 2 3 4 5 6 7 8 9 10; do + rm -f ./downloaded/foo1 ./downloaded/foo2 + testsuccess --nomsg apthelper download-file "http://localhost:${APTHTTPPORT}/foo2" "./downloaded/foo1" '' \ + "http://localhost:${APTHTTPPORT}/foo" './downloaded/foo2' '' -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::http=1 + cp rootdir/tmp/testsuccess.output download.log + testsuccess cmp "$TESTDIR/framework" ./downloaded/foo1 + testsuccess cmp ./downloaded/foo1 ./downloaded/foo2 + + if grep -q '103%20Redirect' ./download.log; then + break + fi + done testequal '1' grep -c '200%20URI%20Start' ./download.log testequal '1' grep -c '103%20Redirect' ./download.log testequal '1' grep -c '201%20URI%20Done' ./download.log @@ -69,7 +79,8 @@ testrun 'httpredirectdown' httpsamedown() { msgtest 'Downloading two files via the same URI to' 'the same file' - testsuccess --nomsg apthelper download-file http://localhost:8080/foo ./downloaded/foo1 '' http://localhost:8080/foo ./downloaded/foo1 '' -o Debug::pkgAcquire::Worker=1 + testsuccess --nomsg apthelper download-file "http://localhost:${APTHTTPPORT}/foo" "./downloaded/foo1" '' \ + "http://localhost:${APTHTTPPORT}/foo" './downloaded/foo1' '' -o Debug::pkgAcquire::Worker=1 cp rootdir/tmp/testsuccess.output download.log testsuccess cmp "$TESTDIR/framework" ./downloaded/foo1 testequal '1' grep -c '200%20URI%20Start' ./download.log