diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-11-21 13:58:10 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-11-21 13:58:51 +0100 |
commit | 8bef48b670244def5f6df6934b5aae6889137ec7 (patch) | |
tree | ab9202010e05bb06c3844e1f395ad79941bc2ff6 /tests | |
parent | 325bd9868711cfe8ed30b7d2e522de762baa192f (diff) | |
download | alpine-conf-8bef48b670244def5f6df6934b5aae6889137ec7.zip |
setup-apkrepos: handle network errors
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/setup_alpine_test | 1 | ||||
-rwxr-xr-x | tests/setup_apkrepos_test | 20 |
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/setup_alpine_test b/tests/setup_alpine_test index 82e64b6..d7fbd87 100755 --- a/tests/setup_alpine_test +++ b/tests/setup_alpine_test @@ -8,6 +8,7 @@ init_tests \ setup_alpine_kvm_clock \ setup_alpine_restart_network +export WGETCONTENT="https://mirror.example.com" setup_alpine_usage_body() { test_usage setup-alpine } diff --git a/tests/setup_apkrepos_test b/tests/setup_apkrepos_test index f70b400..1998dbe 100755 --- a/tests/setup_apkrepos_test +++ b/tests/setup_apkrepos_test @@ -7,7 +7,8 @@ init_tests \ setup_apkrepos_https \ setup_apkrepos_random \ setup_apkrepos_first \ - setup_apkrepos_fastest + setup_apkrepos_fastest \ + setup_apkrepos_network_failure setup_apkrepos_usage_body() { test_usage setup-apkrepos @@ -55,3 +56,20 @@ setup_apkrepos_fastest_body() { -o match:"Added mirror a[0-9].example.com" \ setup-apkrepos -f } + +setup_apkrepos_network_failure_body() { + init_env + MIRRORS_URL=https://example.com/fail \ + atf_check -s not-exit:0 \ + -o match:"Finding" \ + -e match:"Warning! No mirror found" \ + setup-apkrepos -f + MIRRORS_URL=https://example.com/fail \ + atf_check -s not-exit:0 \ + -e match:"Warning" \ + setup-apkrepos -r + MIRRORS_URL=https://example.com/fail \ + atf_check -s not-exit:0 \ + -e match:"Warning! No mirror found" \ + setup-apkrepos -1 +} |