tests: abuild-fetch: test wget failure

This commit is contained in:
Natanael Copa 2022-06-14 17:56:16 +02:00
parent 0c40d8aca7
commit c87b6a47fe

View File

@ -6,7 +6,8 @@ init_tests \
abuild_fetch_curl_invocation \ abuild_fetch_curl_invocation \
abuild_fetch_curl_failure \ abuild_fetch_curl_failure \
abuild_fetch_curl_insecure \ abuild_fetch_curl_insecure \
abuild_fetch_wget_fallback abuild_fetch_wget_fallback \
abuild_fetch_wget_failure
create_fake_curl() { create_fake_curl() {
mkdir bin mkdir bin
@ -79,3 +80,11 @@ abuild_fetch_wget_fallback_body() {
abuild-fetch https://example.com/non-existing abuild-fetch https://example.com/non-existing
} }
abuild_fetch_wget_failure_body() {
create_fake_wget
WGET_EXITCODE=1 PATH="$PWD/bin:$(atf_get_srcdir)/.." atf_check -s exit:1 \
-o match:"Fake wget invoked" \
-e empty \
abuild-fetch https://example.com/non-existing
}