summaryrefslogtreecommitdiff
path: root/tests/setup_apkrepos_test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/setup_apkrepos_test')
-rwxr-xr-xtests/setup_apkrepos_test22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/setup_apkrepos_test b/tests/setup_apkrepos_test
new file mode 100755
index 0000000..bf57b4f
--- /dev/null
+++ b/tests/setup_apkrepos_test
@@ -0,0 +1,22 @@
+#!/usr/bin/env atf-sh
+
+. $(atf_get_srcdir)/test_env.sh
+init_tests \
+ setup_apkrepos_usage \
+ setup_apkrepos_https
+
+setup_apkrepos_usage_body() {
+ test_usage setup-apkrepos
+}
+
+setup_apkrepos_https_body() {
+ init_env
+ export MIRRORS="https://a.example.com http://b.example.com"
+ atf_check -s exit:0 \
+ -o match:"Updating repository indexes..." \
+ -o match:"apk update" \
+ -e empty \
+ setup-apkrepos https://example.com
+ grep -q 'https://example.com' etc/apk/repositories || atf_fail "example.com was not added to /etc/apk/repositories"
+}
+