#!/usr/bin/env atf-sh . $(atf_get_srcdir)/test_env.sh init_tests \ 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" }