summaryrefslogtreecommitdiff
path: root/tests/setup_apkrepos_test
blob: bf57b4f2b54fb7bbf75c161364cc7ebbedc54275 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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"
}