summaryrefslogtreecommitdiff
path: root/tests/setup_apkrepos_test
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-13 15:35:09 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-13 15:52:55 +0200
commita039e6aa8d60509e17e3a22838adb3f6a0ec9264 (patch)
tree2b804f12e3879543120c29a6ecb9f61ec2f3c0bf /tests/setup_apkrepos_test
parent3e2673053162101e14c773c9f4d125a32d123bd2 (diff)
downloadalpine-conf-a039e6aa8d60509e17e3a22838adb3f6a0ec9264.zip
tests: add test for setup-apkrepos
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"
+}
+