summaryrefslogtreecommitdiff
path: root/tests/setup_apkrepos_test
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-11-21 13:58:10 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2022-11-21 13:58:51 +0100
commit8bef48b670244def5f6df6934b5aae6889137ec7 (patch)
treeab9202010e05bb06c3844e1f395ad79941bc2ff6 /tests/setup_apkrepos_test
parent325bd9868711cfe8ed30b7d2e522de762baa192f (diff)
downloadalpine-conf-8bef48b670244def5f6df6934b5aae6889137ec7.zip
setup-apkrepos: handle network errors
Diffstat (limited to 'tests/setup_apkrepos_test')
-rwxr-xr-xtests/setup_apkrepos_test20
1 files changed, 19 insertions, 1 deletions
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
+}