diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-12 12:52:58 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-05-12 12:52:58 +0200 |
commit | 31e63870eaa1c14d36b567a64a6646db1060cd4d (patch) | |
tree | 91c71bafb522cd377d4911335c728b345ebfc47e /tests | |
parent | eb6a9e84c403e2e15c2edb9a87ef4916618f0d8a (diff) | |
download | alpine-conf-31e63870eaa1c14d36b567a64a6646db1060cd4d.zip |
tests: setup-dns add tests for non-interactive
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/setup_dns_test | 22 |
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" +} |