From c87b6a47fec79af748a49ae6d5db9100ebb49574 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 14 Jun 2022 17:56:16 +0200 Subject: [PATCH] tests: abuild-fetch: test wget failure --- tests/abuild_fetch_test | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/abuild_fetch_test b/tests/abuild_fetch_test index 9e7e8d4..7c8bf73 100755 --- a/tests/abuild_fetch_test +++ b/tests/abuild_fetch_test @@ -6,7 +6,8 @@ init_tests \ abuild_fetch_curl_invocation \ abuild_fetch_curl_failure \ abuild_fetch_curl_insecure \ - abuild_fetch_wget_fallback + abuild_fetch_wget_fallback \ + abuild_fetch_wget_failure create_fake_curl() { mkdir bin @@ -79,3 +80,11 @@ abuild_fetch_wget_fallback_body() { 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 +} +