From 325bd9868711cfe8ed30b7d2e522de762baa192f Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 21 Nov 2022 13:27:58 +0100 Subject: setup-apkrepos: add test for fastest mirror (-f) --- tests/setup_apkrepos_test | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests/setup_apkrepos_test') 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 +} -- cgit v1.2.3