diff options
-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" +} |