summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bin/wget4
-rwxr-xr-xtests/setup_apkrepos_test12
2 files changed, 14 insertions, 2 deletions
diff --git a/tests/bin/wget b/tests/bin/wget
index 77144b9..ad5f235 100755
--- a/tests/bin/wget
+++ b/tests/bin/wget
@@ -33,7 +33,7 @@ msg() {
fi
}
-OPTS=$(getopt -l quiet,help,spider -o "qhO:" -n $prog -- "$@") || usage "1" >&2
+OPTS=$(getopt -l quiet,help,spider,timeout,tries -o "qhO:T:t:" -n $prog -- "$@") || usage "1" >&2
quiet=
eval set -- "$OPTS"
@@ -53,6 +53,8 @@ while true; do
shift
outfile="$1"
;;
+ -T|--timeout) shift;;
+ -t|--tries) shift;;
--)
shift
break
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
+}