diff options
| author | Felix Moessbauer <felix.moessbauer@siemens.com> | 2024-11-13 15:48:43 +0100 |
|---|---|---|
| committer | Felix Moessbauer <felix.moessbauer@siemens.com> | 2024-11-18 13:44:49 +0100 |
| commit | cabcaf3c326408bf71a9a83f51973214fddcefb1 (patch) | |
| tree | 93b78b07910e9c072ef6f2b65f361de20da4a4d8 /test/integration | |
| parent | 7b9dea5a7c43fd91bcd23d1585d39a726d098285 (diff) | |
http: add test for Retry-After handling
When enabling Acquire::Retries::HandleRetryAfter, the value of the
Retry-After http header is honored and the retry is not executed earlier
than this point in time (except if that is longer than the max delay
time). The added test checks if the request is delayed at least by the
requested time.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Diffstat (limited to 'test/integration')
| -rwxr-xr-x | test/integration/test-bug-869859-retry-downloads | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/integration/test-bug-869859-retry-downloads b/test/integration/test-bug-869859-retry-downloads index 4e169b3b9..333ce816e 100755 --- a/test/integration/test-bug-869859-retry-downloads +++ b/test/integration/test-bug-869859-retry-downloads @@ -51,6 +51,15 @@ Err:1 http://localhost:${APTHTTPPORT} stable/main all testpkg all 1 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 testfailure test -f testpkg_1_all.deb +msgmsg 'Retry 429 TooManyRequests after Retry-After time' +webserverconfig 'aptwebserver::failrequest' '429' +webserverconfig 'aptwebserver::failrequest::retryafter' '5' +webserverconfig 'aptwebserver::failrequest::pool/testpkg_1_all.deb' '1' +testsecondsgreaterequal 5 testsuccess apt download testpkg -o acquire::retries=1 -o acquire::retries::handleretryafter=true -o debug::acquire::retries=true -q +webserverconfig 'aptwebserver::failrequest::retryafter' '0' +testsuccess test -f testpkg_1_all.deb +rm -f testpkg_1_all.deb + msgmsg 'Success in the third try' webserverconfig 'aptwebserver::failrequest::pool/testpkg_1_all.deb' '2' testsuccess apt download testpkg -o acquire::retries=3 -o acquire::retries::delay=false |
