summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-11-22 21:02:46 +0000
committerJulian Andres Klode <jak@debian.org>2024-11-22 21:02:46 +0000
commit731c8bf96c06abce3797859e5d784e2caaf137c3 (patch)
tree76174389ed4e5a9f61cf8dad20a06ceede8bd8cb /test/integration
parent1a03ebc11982f052259a6b677ebc520f8d47cb81 (diff)
parenta732f74400147a9993358b4778335715a0d5e20e (diff)
Merge branch 'fix/collect-ignored-errors' into 'main'
Collect unprinted Ign errors for display in Err output See merge request apt-team/apt!405
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-bug-869859-retry-downloads31
-rwxr-xr-xtest/integration/test-handle-redirect-as-used-mirror-change13
2 files changed, 42 insertions, 2 deletions
diff --git a/test/integration/test-bug-869859-retry-downloads b/test/integration/test-bug-869859-retry-downloads
index 333ce816e..821d7bc3e 100755
--- a/test/integration/test-bug-869859-retry-downloads
+++ b/test/integration/test-bug-869859-retry-downloads
@@ -48,7 +48,17 @@ Ign:1 http://localhost:${APTHTTPPORT} stable/main all testpkg all 1
429 Unknown HTTP code
Err:1 http://localhost:${APTHTTPPORT} stable/main all testpkg all 1
429 Unknown HTTP code
-E: Failed to fetch http://localhost:${APTHTTPPORT}/pool/testpkg_1_all.deb 429 Unknown HTTP code" apt download testpkg -o acquire::retries=3 -o debug::acquire::retries=true -q
+E: Failed to fetch http://localhost:${APTHTTPPORT}/pool/testpkg_1_all.deb 429 Unknown HTTP code" apt download testpkg -o acquire::retries=3 -o debug::acquire::retries=true -q -o Acquire::Progress::Ignore::ShowErrorText=true
+testfailure test -f testpkg_1_all.deb
+testsecondsgreaterequal 5 testfailureequal "Delaying http://localhost:${APTHTTPPORT} stable/main all testpkg all 1 by 1 seconds
+Ign:1 http://localhost:${APTHTTPPORT} stable/main all testpkg all 1
+Delaying http://localhost:${APTHTTPPORT} stable/main all testpkg all 1 by 2 seconds
+Ign:1 http://localhost:${APTHTTPPORT} stable/main all testpkg all 1
+Delaying http://localhost:${APTHTTPPORT} stable/main all testpkg all 1 by 4 seconds
+Ign:1 http://localhost:${APTHTTPPORT} stable/main all testpkg all 1
+Err:1 http://localhost:${APTHTTPPORT} stable/main all testpkg all 1
+ 429 Unknown HTTP code
+E: Failed to fetch http://localhost:${APTHTTPPORT}/pool/testpkg_1_all.deb 429 Unknown HTTP code" apt download testpkg -o acquire::retries=3 -o debug::acquire::retries=true -q -o Acquire::Progress::Ignore::ShowErrorText=false
testfailure test -f testpkg_1_all.deb
msgmsg 'Retry 429 TooManyRequests after Retry-After time'
@@ -66,6 +76,25 @@ testsuccess apt download testpkg -o acquire::retries=3 -o acquire::retries::dela
testsuccess test -f testpkg_1_all.deb
rm -f testpkg_1_all.deb
+msgmsg 'Hard failure after retry request'
+webserverconfig 'aptwebserver::failrequest::pool/unavailable_1_all.deb' '1'
+testfailureequal "Ign:1 http://localhost:${APTHTTPPORT}/pool/unavailable_1_all.deb
+ 429 Unknown HTTP code
+Err:1 http://localhost:${APTHTTPPORT}/pool/unavailable_1_all.deb
+ 404 Not Found
+E: Failed to fetch http://localhost:${APTHTTPPORT}/pool/unavailable_1_all.deb 404 Not Found
+E: Download Failed" apthelper download-file "http://localhost:${APTHTTPPORT}/pool/unavailable_1_all.deb" 'unavailable_1_all.deb' -o acquire::retries=2 -o acquire::retries::delay=false -o Acquire::Progress::Ignore::ShowErrorText=true
+testfailure test -f unavailable_1_all.deb
+webserverconfig 'aptwebserver::failrequest::pool/unavailable_1_all.deb' '1'
+testfailureequal "Ign:1 http://localhost:${APTHTTPPORT}/pool/unavailable_1_all.deb
+Err:1 http://localhost:${APTHTTPPORT}/pool/unavailable_1_all.deb
+ 429 Unknown HTTP code
+ 404 Not Found
+E: Failed to fetch http://localhost:${APTHTTPPORT}/pool/unavailable_1_all.deb 404 Not Found
+E: Download Failed" apthelper download-file "http://localhost:${APTHTTPPORT}/pool/unavailable_1_all.deb" 'unavailable_1_all.deb' -o acquire::retries=2 -o acquire::retries::delay=false -o Acquire::Progress::Ignore::ShowErrorText=false
+testfailure test -f unavailable_1_all.deb
+
+
msgmsg 'Do not try everything again, hard failures keep hard failures'
webserverconfig 'aptwebserver::failrequest' '404'
webserverconfig 'aptwebserver::failrequest::pool/testpkg_1_all.deb' '2'
diff --git a/test/integration/test-handle-redirect-as-used-mirror-change b/test/integration/test-handle-redirect-as-used-mirror-change
index a6f8b788f..1ce1232e2 100755
--- a/test/integration/test-handle-redirect-as-used-mirror-change
+++ b/test/integration/test-handle-redirect-as-used-mirror-change
@@ -67,7 +67,18 @@ Get:3 http://0.0.0.0:${APTHTTPPORT} unstable/main all Packages [$(stat -c %s apt
Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
Reading package lists...
Building dependency tree...
-All packages are up to date." apt update
+All packages are up to date." apt update -o Acquire::Progress::Ignore::ShowErrorText=true
+rm -rf rootdir/var/lib/apt/lists
+testsuccessequal "Get:1 http://0.0.0.0:${APTHTTPPORT}/storage unstable InRelease [$(stat -c %s aptarchive/storage/dists/unstable/InRelease) B]
+Ign:2 http://0.0.0.0:${APTHTTPPORT}/storage unstable/main Sources
+Ign:3 http://0.0.0.0:${APTHTTPPORT}/storage unstable/main all Packages
+Ign:4 http://0.0.0.0:${APTHTTPPORT}/storage unstable/main Translation-en
+Get:2 http://0.0.0.0:${APTHTTPPORT} unstable/main Sources [$(stat -c %s aptarchive/dists/unstable/main/source/Sources.gz) B]
+Get:3 http://0.0.0.0:${APTHTTPPORT} unstable/main all Packages [$(stat -c %s aptarchive/dists/unstable/main/binary-all/Packages.gz) B]
+Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B]
+Reading package lists...
+Building dependency tree...
+All packages are up to date." apt update -o Acquire::Progress::Ignore::ShowErrorText=false
find aptarchive -name 'InRelease' -delete
rm -rf rootdir/var/lib/apt/lists