summaryrefslogtreecommitdiff
path: root/tests/setup_apkrepos_test
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-11-21 13:27:58 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2022-11-21 13:27:58 +0100
commit325bd9868711cfe8ed30b7d2e522de762baa192f (patch)
tree0655708ff34ec07ecb7561db095dd9ad3f4776bc /tests/setup_apkrepos_test
parent15d7b8dc21e77acc343a94d7869764caae7f497d (diff)
downloadalpine-conf-325bd9868711cfe8ed30b7d2e522de762baa192f.zip
setup-apkrepos: add test for fastest mirror (-f)
Diffstat (limited to 'tests/setup_apkrepos_test')
-rwxr-xr-xtests/setup_apkrepos_test12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/setup_apkrepos_test b/tests/setup_apkrepos_test
index ec0c349..f70b400 100755
--- a/tests/setup_apkrepos_test
+++ b/tests/setup_apkrepos_test
@@ -6,7 +6,8 @@ init_tests \
setup_apkrepos_exclusive_opts \
setup_apkrepos_https \
setup_apkrepos_random \
- setup_apkrepos_first
+ setup_apkrepos_first \
+ setup_apkrepos_fastest
setup_apkrepos_usage_body() {
test_usage setup-apkrepos
@@ -45,3 +46,12 @@ setup_apkrepos_first_body() {
-o match:"Added mirror a0.example.com" \
setup-apkrepos -1
}
+
+setup_apkrepos_fastest_body() {
+ init_env
+ export WGETCONTENT="$(seq 0 9 | awk '{print "https://a" $0 ".example.com"}')"
+ atf_check -s exit:0 \
+ -e match:"^[0-9].*example.com" \
+ -o match:"Added mirror a[0-9].example.com" \
+ setup-apkrepos -f
+}