summaryrefslogtreecommitdiff
path: root/test/integration/test-bug-869859-retry-downloads
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/test-bug-869859-retry-downloads')
-rwxr-xr-xtest/integration/test-bug-869859-retry-downloads18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/integration/test-bug-869859-retry-downloads b/test/integration/test-bug-869859-retry-downloads
index a62429a53..86203f794 100755
--- a/test/integration/test-bug-869859-retry-downloads
+++ b/test/integration/test-bug-869859-retry-downloads
@@ -35,3 +35,21 @@ webserverconfig 'aptwebserver::failrequest' '404'
webserverconfig 'aptwebserver::failrequest::pool/testpkg_1_all.deb' '2'
testfailure apt download testpkg -o acquire::retries=3
testfailure test -f testpkg_1_all.deb
+
+cat ../rootdir/etc/apt/sources.list.d/apt-test-*.list > ../rootdir/etc/apt/sources.list.d/00http-source.list
+changetohttpswebserver
+
+msgmsg 'Check download from alternative sources if first failed'
+webserverconfig 'aptwebserver::failrequest::pool/testpkg_1_all.deb' '0'
+testsuccess apt update
+testsuccess apt download testpkg -o acquire::retries=0
+testsuccess test -f testpkg_1_all.deb
+rm -f testpkg_1_all.deb
+
+# we make the first source fail by disabling http support
+webserverconfig 'aptwebserver::support::http' 'false'
+testsuccess apt download testpkg -o acquire::retries=0
+cp ../rootdir/tmp/testsuccess.output alt.output
+testsuccess grep '^ 400 Bad Request' alt.output
+testsuccess test -f testpkg_1_all.deb
+rm -f testpkg_1_all.deb