summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-05-12 12:52:58 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-05-12 12:52:58 +0200
commit31e63870eaa1c14d36b567a64a6646db1060cd4d (patch)
tree91c71bafb522cd377d4911335c728b345ebfc47e /tests
parenteb6a9e84c403e2e15c2edb9a87ef4916618f0d8a (diff)
downloadalpine-conf-31e63870eaa1c14d36b567a64a6646db1060cd4d.zip
tests: setup-dns add tests for non-interactive
Diffstat (limited to 'tests')
-rwxr-xr-xtests/setup_dns_test22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/setup_dns_test b/tests/setup_dns_test
index df461a7..146cbf0 100755
--- a/tests/setup_dns_test
+++ b/tests/setup_dns_test
@@ -2,9 +2,29 @@
. $(atf_get_srcdir)/test_env.sh
init_tests \
- setup_dns_usage
+ setup_dns_usage \
+ setup_dns_ip \
+ setup_dns_domain
setup_dns_usage_body() {
test_usage setup-dns
}
+setup_dns_ip_body() {
+ init_env
+ atf_check -s exit:0 \
+ -o empty \
+ -e empty \
+ setup-dns 1.1.1.1
+ grep -q '^nameserver 1.1.1.1' etc/resolv.conf || atf_fail "nameserver was not set in etc/resolv.conf"
+}
+
+setup_dns_domain_body() {
+ init_env
+ atf_check -s exit:0 \
+ -o empty \
+ -e empty \
+ setup-dns -d example.com 1.1.1.1
+ grep -q '^nameserver 1.1.1.1' etc/resolv.conf || atf_fail "nameserver was not set in etc/resolv.conf"
+ grep -q 'search example\.com' etc/resolv.conf || atf_fail "search was not set in etc/resolv.conf"
+}