diff --git a/run-tests b/run-tests index 68e26ca..d71cecb 100755 --- a/run-tests +++ b/run-tests @@ -14,18 +14,36 @@ # GNU General Public License for more details. # Set colour escape sequences -RED='\033[0;31m' -YELLOW='\033[1;33m' -ORANGE='\033[0;33m' -GREEN='\033[0;32m' -DARK='\033[1;30m' -RESET='\033[0m' + +PS4='+ ${BASH_SOURCE:-$0}@${LINENO:-0}${FUNCNAME:+#${FUNCNAME}()}: ' + +if [[ -n "${NO_COLOR:-}" ]] || ! colors="$(tput colors 2>/dev/null)" || (( "${colors:-0}" < 16 )); then + RED='' + YELLOW='' + ORANGE='' + GREEN='' + DARK='' + RESET='' +else + RED='\033[0;31m' + YELLOW='\033[1;33m' + ORANGE='\033[0;33m' + GREEN='\033[0;32m' + DARK='\033[1;30m' + RESET='\033[0m' +fi + # Set Pass/Fail signatures PASS="✓" FAIL="✗" + # Counters COUNT_PASS=0 COUNT_FAIL=0 + +# Names of files in which test cases failed +declare -A FAILED + # Flag for determining whether a test script called the `runtest' function RUNTEST_CALLED=0 @@ -284,6 +302,9 @@ function _pass { function _fail { COUNT_FAIL=$((COUNT_FAIL+1)) + if [[ -v TEST ]]; then + FAILED["$TEST"]=1 + fi ( >&2 echo -e " ${RED}${FAIL} ${@}${RESET}" ) } @@ -342,16 +363,28 @@ evaltest() { TEST_BUSCTL_STATUS_RC="" # Keep this random, as we will never know the ifindex up-front ip_ifindex=$((RANDOM%=64)) + # Same for the device + dev="tun${RANDOM}" # Clear foreign_option_* - for foreign_option_varname in "${!foreign_option_@}"; do - declare "${foreign_option_varname}=" - done + unset "${!foreign_option_@}" # Import the test configuration - source "${TEST}" + source "${TEST}" || return + + if (( RUNTEST_CALLED > 0 )); then + return + fi + + declare -a foreign_options || return + + local i=0 + local opt + for opt in "${foreign_options[@]}" in; do + declare "foreign_option_$(( i += 1 ))=${opt}" + done - (( RUNTEST_CALLED > 0 )) || runtest + runtest } echo "update-systemd-resolved Test Suite" @@ -376,5 +409,13 @@ done echo -e " ${GREEN}${PASS} ${COUNT_PASS} Passed${RESET}" echo -e " ${RED}${FAIL} ${COUNT_FAIL} Failed${RESET}" +if (( "${#FAILED[@]}" > 0 )); then + echo -e "\n ${YELLOW}The following files have failing test cases:${RESET}" + + for failed in "${!FAILED[@]}"; do + echo -e " ${ORANGE}${failed}${RESET}" + done +fi + # Make sure we fail if there are failed tests [[ ${COUNT_FAIL} -eq 0 ]] diff --git a/tests/01_no_updates.sh b/tests/01_no_updates.sh index ed17a72..fda7906 100644 --- a/tests/01_no_updates.sh +++ b/tests/01_no_updates.sh @@ -1,6 +1,5 @@ # Emulate OpenVPN environment script_type="up" -dev="tun01" TEST_TITLE="No Updates" TEST_BUSCTL_CALLED=1 diff --git a/tests/02_single_ipv4_dns.sh b/tests/02_single_ipv4_dns.sh index 5e7a7e6..5e59152 100644 --- a/tests/02_single_ipv4_dns.sh +++ b/tests/02_single_ipv4_dns.sh @@ -1,6 +1,6 @@ script_type="up" -dev="tun02" -foreign_option_1="dhcp-option DNS 1.23.4.56" + +foreign_options=("dhcp-option DNS 1.23.4.56") TEST_TITLE="Single IPv4 DNS Server" TEST_BUSCTL_CALLED=1 diff --git a/tests/03a_multiple_ipv4_dns_1.sh b/tests/03a_multiple_ipv4_dns_1.sh index e72fb84..17d77f9 100644 --- a/tests/03a_multiple_ipv4_dns_1.sh +++ b/tests/03a_multiple_ipv4_dns_1.sh @@ -1,7 +1,10 @@ script_type="up" -dev="tun03" -foreign_option_1="dhcp-option DNS 1.23.4.56" -foreign_option_2="dhcp-option DNS 5.6.7.89" + + +foreign_options=( + "dhcp-option DNS 1.23.4.56" + "dhcp-option DNS 5.6.7.89" +) TEST_TITLE="Multiple IPv4 DNS Servers (Part 1)" TEST_BUSCTL_CALLED=1 diff --git a/tests/03b_multiple_ipv4_dns_2.sh b/tests/03b_multiple_ipv4_dns_2.sh index ec0d172..3118887 100644 --- a/tests/03b_multiple_ipv4_dns_2.sh +++ b/tests/03b_multiple_ipv4_dns_2.sh @@ -1,8 +1,10 @@ script_type="up" -dev="tun03" -foreign_option_1="dhcp-option DNS 1.23.4.56" -foreign_option_2="dhcp-option DNS 5.6.7.89" -foreign_option_3="dhcp-option DNS 34.5.67.8" + +foreign_options=( + "dhcp-option DNS 1.23.4.56" + "dhcp-option DNS 5.6.7.89" + "dhcp-option DNS 34.5.67.8" +) TEST_TITLE="Multiple IPv4 DNS Servers (Part 2)" TEST_BUSCTL_CALLED=1 diff --git a/tests/04a_single_dns_domain.sh b/tests/04a_single_dns_domain.sh index 5038ad2..76ba3b0 100644 --- a/tests/04a_single_dns_domain.sh +++ b/tests/04a_single_dns_domain.sh @@ -1,6 +1,6 @@ script_type="up" -dev="tun04" -foreign_option_1="dhcp-option DOMAIN example.com" + +foreign_options=("dhcp-option DOMAIN example.com") TEST_TITLE="Single DNS Domain" TEST_BUSCTL_CALLED=1 diff --git a/tests/04b_multiple_dns_domains.sh b/tests/04b_multiple_dns_domains.sh index 4ac8717..249ab47 100644 --- a/tests/04b_multiple_dns_domains.sh +++ b/tests/04b_multiple_dns_domains.sh @@ -1,7 +1,9 @@ script_type="up" -dev="tun04" -foreign_option_1="dhcp-option DOMAIN example.com" -foreign_option_2="dhcp-option DOMAIN example.co" + +foreign_options=( + "dhcp-option DOMAIN example.com" + "dhcp-option DOMAIN example.co" +) TEST_TITLE="Multiple DNS Domains" TEST_BUSCTL_CALLED=1 diff --git a/tests/05a_dns_domain_and_search_1.sh b/tests/05a_dns_domain_and_search_1.sh index 9a0d6a6..a8feccb 100644 --- a/tests/05a_dns_domain_and_search_1.sh +++ b/tests/05a_dns_domain_and_search_1.sh @@ -1,7 +1,9 @@ script_type="up" -dev="tun05" -foreign_option_1="dhcp-option DOMAIN example.com" -foreign_option_2="dhcp-option DOMAIN-SEARCH example.org" + +foreign_options=( + "dhcp-option DOMAIN example.com" + "dhcp-option DOMAIN-SEARCH example.org" +) TEST_TITLE="DNS Single Domain and Single Search" TEST_BUSCTL_CALLED=1 diff --git a/tests/05b_dns_domain_and_search_2.sh b/tests/05b_dns_domain_and_search_2.sh index a76b3cd..36a5634 100644 --- a/tests/05b_dns_domain_and_search_2.sh +++ b/tests/05b_dns_domain_and_search_2.sh @@ -1,8 +1,10 @@ script_type="up" -dev="tun05" -foreign_option_1="dhcp-option DOMAIN example.com" -foreign_option_2="dhcp-option DOMAIN-SEARCH example.org" -foreign_option_3="dhcp-option DOMAIN-SEARCH example.net" + +foreign_options=( + "dhcp-option DOMAIN example.com" + "dhcp-option DOMAIN-SEARCH example.org" + "dhcp-option DOMAIN-SEARCH example.net" +) TEST_TITLE="DNS Single Domain and Dual Search" TEST_BUSCTL_CALLED=1 diff --git a/tests/05c_dns_domain_and_search_3.sh b/tests/05c_dns_domain_and_search_3.sh index 39d8dda..897e697 100644 --- a/tests/05c_dns_domain_and_search_3.sh +++ b/tests/05c_dns_domain_and_search_3.sh @@ -1,8 +1,10 @@ script_type="up" -dev="tun05" -foreign_option_1="dhcp-option DOMAIN-SEARCH example.org" -foreign_option_2="dhcp-option DOMAIN example.com" -foreign_option_3="dhcp-option DOMAIN-SEARCH example.net" + +foreign_options=( + "dhcp-option DOMAIN-SEARCH example.org" + "dhcp-option DOMAIN example.com" + "dhcp-option DOMAIN-SEARCH example.net" +) TEST_TITLE="DNS Single Domain and Dual Search (with Order Check)" TEST_BUSCTL_CALLED=1 diff --git a/tests/05d_dns_domain_and_search_4.sh b/tests/05d_dns_domain_and_search_4.sh index 1e863d8..414b4f9 100644 --- a/tests/05d_dns_domain_and_search_4.sh +++ b/tests/05d_dns_domain_and_search_4.sh @@ -1,9 +1,11 @@ script_type="up" -dev="tun05" -foreign_option_1="dhcp-option DOMAIN-SEARCH example.org" -foreign_option_2="dhcp-option DOMAIN example.co" -foreign_option_3="dhcp-option DOMAIN example.com" -foreign_option_4="dhcp-option DOMAIN-SEARCH example.net" + +foreign_options=( + "dhcp-option DOMAIN-SEARCH example.org" + "dhcp-option DOMAIN example.co" + "dhcp-option DOMAIN example.com" + "dhcp-option DOMAIN-SEARCH example.net" +) TEST_TITLE="DNS Dual Domain and Dual Search (with Order Check)" TEST_BUSCTL_CALLED=1 diff --git a/tests/05e_dns_domain_alternate.sh b/tests/05e_dns_domain_alternate.sh index 1733a3e..ff6de15 100644 --- a/tests/05e_dns_domain_alternate.sh +++ b/tests/05e_dns_domain_alternate.sh @@ -1,6 +1,6 @@ script_type="up" -dev="tun05" -foreign_option_1="dhcp-option ADAPTER_DOMAIN_SUFFIX example.org" + +foreign_options=("dhcp-option ADAPTER_DOMAIN_SUFFIX example.org") TEST_TITLE="DNS Doamin using ADAPTER_DOMAIN_SUFFIX" TEST_BUSCTL_CALLED=1 diff --git a/tests/06a_single_domain_route.sh b/tests/06a_single_domain_route.sh index 61275b0..ea94440 100644 --- a/tests/06a_single_domain_route.sh +++ b/tests/06a_single_domain_route.sh @@ -1,6 +1,6 @@ script_type="up" -dev="tun06" -foreign_option_1="dhcp-option DOMAIN-ROUTE example.com" + +foreign_options=("dhcp-option DOMAIN-ROUTE example.com") TEST_TITLE="Single DNS Route" TEST_BUSCTL_CALLED=1 diff --git a/tests/06b_multiple_domain_routes.sh b/tests/06b_multiple_domain_routes.sh index 0829512..14b0c73 100644 --- a/tests/06b_multiple_domain_routes.sh +++ b/tests/06b_multiple_domain_routes.sh @@ -1,8 +1,10 @@ script_type="up" -dev="tun06" -foreign_option_1="dhcp-option DOMAIN-ROUTE example.com" -foreign_option_2="dhcp-option DOMAIN-ROUTE example.co" -foreign_option_3="dhcp-option DOMAIN-ROUTE example.co.uk" + +foreign_options=( + "dhcp-option DOMAIN-ROUTE example.com" + "dhcp-option DOMAIN-ROUTE example.co" + "dhcp-option DOMAIN-ROUTE example.co.uk" +) TEST_TITLE="Single DNS Route" TEST_BUSCTL_DOMAINS="3 example.com true example.co true example.co.uk true" diff --git a/tests/07a_dns_domain_search_and_route_1.sh b/tests/07a_dns_domain_search_and_route_1.sh index 0d1e8e0..d549e53 100644 --- a/tests/07a_dns_domain_search_and_route_1.sh +++ b/tests/07a_dns_domain_search_and_route_1.sh @@ -1,9 +1,11 @@ script_type="up" -dev="tun07" -foreign_option_1="dhcp-option DOMAIN example.com" -foreign_option_2="dhcp-option DOMAIN-SEARCH example.org" -foreign_option_3="dhcp-option DOMAIN-SEARCH example.co.uk" -foreign_option_4="dhcp-option DOMAIN-ROUTE example.net" + +foreign_options=( + "dhcp-option DOMAIN example.com" + "dhcp-option DOMAIN-SEARCH example.org" + "dhcp-option DOMAIN-SEARCH example.co.uk" + "dhcp-option DOMAIN-ROUTE example.net" +) TEST_TITLE="DNS Single Domain, Dual Search, Single Route" TEST_BUSCTL_CALLED=1 diff --git a/tests/07b_dns_domain_search_and_route_2.sh b/tests/07b_dns_domain_search_and_route_2.sh index 0281a29..2802c44 100644 --- a/tests/07b_dns_domain_search_and_route_2.sh +++ b/tests/07b_dns_domain_search_and_route_2.sh @@ -1,11 +1,13 @@ script_type="up" -dev="tun07" -foreign_option_1="dhcp-option DOMAIN example.com" -foreign_option_2="dhcp-option DOMAIN-SEARCH example.org" -foreign_option_3="dhcp-option DOMAIN-ROUTE example.net" -foreign_option_4="dhcp-option DOMAIN-SEARCH example.co.uk" -foreign_option_5="dhcp-option DOMAIN example.co" -foreign_option_6="dhcp-option DOMAIN-ROUTE example.uk.com" + +foreign_options=( + "dhcp-option DOMAIN example.com" + "dhcp-option DOMAIN-SEARCH example.org" + "dhcp-option DOMAIN-ROUTE example.net" + "dhcp-option DOMAIN-SEARCH example.co.uk" + "dhcp-option DOMAIN example.co" + "dhcp-option DOMAIN-ROUTE example.uk.com" +) TEST_TITLE="DNS Dual Domain, Dual Search, Dual Route (with Order Check)" TEST_BUSCTL_CALLED=1 diff --git a/tests/08a_dns_ipv4_and_domain.sh b/tests/08a_dns_ipv4_and_domain.sh index 81b5c8e..4be7ec3 100644 --- a/tests/08a_dns_ipv4_and_domain.sh +++ b/tests/08a_dns_ipv4_and_domain.sh @@ -1,8 +1,10 @@ script_type="up" -dev="tun08" -foreign_option_1="dhcp-option DNS 1.23.4.56" -foreign_option_2="dhcp-option DNS 2.34.56.7" -foreign_option_3="dhcp-option DOMAIN example.com" + +foreign_options=( + "dhcp-option DNS 1.23.4.56" + "dhcp-option DNS 2.34.56.7" + "dhcp-option DOMAIN example.com" +) TEST_TITLE="DNS IPv4 Servers and Domain" TEST_BUSCTL_CALLED=1 diff --git a/tests/08b_dns_ipv4_domain_and_search.sh b/tests/08b_dns_ipv4_domain_and_search.sh index 327e048..af356f7 100644 --- a/tests/08b_dns_ipv4_domain_and_search.sh +++ b/tests/08b_dns_ipv4_domain_and_search.sh @@ -1,10 +1,12 @@ script_type="up" -dev="tun08" -foreign_option_1="dhcp-option DNS 1.23.4.56" -foreign_option_2="dhcp-option DNS 2.34.5.67" -foreign_option_3="dhcp-option DOMAIN example.co.uk" -foreign_option_4="dhcp-option DOMAIN-SEARCH example.co" -foreign_option_5="dhcp-option DOMAIN-SEARCH example.com" + +foreign_options=( + "dhcp-option DNS 1.23.4.56" + "dhcp-option DNS 2.34.5.67" + "dhcp-option DOMAIN example.co.uk" + "dhcp-option DOMAIN-SEARCH example.co" + "dhcp-option DOMAIN-SEARCH example.com" +) TEST_TITLE="DNS IPv4 Servers, Domain, and Search" TEST_BUSCTL_CALLED=1 diff --git a/tests/08b_dns_ipv4_domain_search_and_route.sh b/tests/08b_dns_ipv4_domain_search_and_route.sh index 8b3aadc..73244bc 100644 --- a/tests/08b_dns_ipv4_domain_search_and_route.sh +++ b/tests/08b_dns_ipv4_domain_search_and_route.sh @@ -1,10 +1,12 @@ script_type="up" -dev="tun08" -foreign_option_1="dhcp-option DNS 1.23.4.56" -foreign_option_2="dhcp-option DNS 2.34.5.67" -foreign_option_3="dhcp-option DOMAIN example.co.uk" -foreign_option_4="dhcp-option DOMAIN-SEARCH example.co" -foreign_option_5="dhcp-option DOMAIN-ROUTE example.com" + +foreign_options=( + "dhcp-option DNS 1.23.4.56" + "dhcp-option DNS 2.34.5.67" + "dhcp-option DOMAIN example.co.uk" + "dhcp-option DOMAIN-SEARCH example.co" + "dhcp-option DOMAIN-ROUTE example.com" +) TEST_TITLE="DNS IPv4 Servers, Domain, Search, and Route" TEST_BUSCTL_CALLED=1 diff --git a/tests/10_single_ipv6_dns_full.sh b/tests/10_single_ipv6_dns_full.sh index 69f3bbf..571d595 100644 --- a/tests/10_single_ipv6_dns_full.sh +++ b/tests/10_single_ipv6_dns_full.sh @@ -1,6 +1,6 @@ script_type="up" -dev="tun10" -foreign_option_1="dhcp-option DNS 1234:5678:90ab:cdef:4321:8765:ba09:fedc" + +foreign_options=("dhcp-option DNS 1234:5678:90ab:cdef:4321:8765:ba09:fedc") TEST_TITLE="Single IPv6 DNS Server (Full)" TEST_BUSCTL_CALLED=1 diff --git a/tests/11_single_ipv6_dns_simple.sh b/tests/11_single_ipv6_dns_simple.sh index 283d2bb..3837537 100644 --- a/tests/11_single_ipv6_dns_simple.sh +++ b/tests/11_single_ipv6_dns_simple.sh @@ -1,6 +1,6 @@ script_type="up" -dev="tun11" -foreign_option_1="dhcp-option DNS 1234:567:89:0:ab:cde:f123:4567" + +foreign_options=("dhcp-option DNS 1234:567:89:0:ab:cde:f123:4567") TEST_TITLE="Single IPv6 DNS Server (Full, Simple)" TEST_BUSCTL_CALLED=1 diff --git a/tests/12_single_ipv6_dns_compact_1.sh b/tests/12_single_ipv6_dns_compact_1.sh index d5a67f9..12b8f16 100644 --- a/tests/12_single_ipv6_dns_compact_1.sh +++ b/tests/12_single_ipv6_dns_compact_1.sh @@ -1,6 +1,6 @@ script_type="up" -dev="tun12" -foreign_option_1="dhcp-option DNS 1234:567:89:0:ab:cde:f123:4567" + +foreign_options=("dhcp-option DNS 1234:567:89:0:ab:cde:f123:4567") TEST_TITLE="Single IPv6 DNS Server (Compact) (Part 1)" TEST_BUSCTL_CALLED=1 diff --git a/tests/13_single_ipv6_dns_compact_2.sh b/tests/13_single_ipv6_dns_compact_2.sh index 4dca1f4..fca63c1 100644 --- a/tests/13_single_ipv6_dns_compact_2.sh +++ b/tests/13_single_ipv6_dns_compact_2.sh @@ -1,6 +1,6 @@ script_type="up" -dev="tun13" -foreign_option_1="dhcp-option DNS 1234:567:89::ab:cdef" + +foreign_options=("dhcp-option DNS 1234:567:89::ab:cdef") TEST_TITLE="Single IPv6 DNS Server (Compact) (Part 2)" TEST_BUSCTL_CALLED=1 diff --git a/tests/14_single_ipv6_dns_compact_3.sh b/tests/14_single_ipv6_dns_compact_3.sh index fa5d35b..e513472 100644 --- a/tests/14_single_ipv6_dns_compact_3.sh +++ b/tests/14_single_ipv6_dns_compact_3.sh @@ -1,6 +1,6 @@ script_type="up" -dev="tun14" -foreign_option_1="dhcp-option DNS 20a0::1" + +foreign_options=("dhcp-option DNS 20a0::1") TEST_TITLE="Single IPv6 DNS Server (Compact) (Part 3)" TEST_BUSCTL_CALLED=1 diff --git a/tests/15_single_ipv6_dns_localhost.sh b/tests/15_single_ipv6_dns_localhost.sh index 27d4c9c..62540af 100644 --- a/tests/15_single_ipv6_dns_localhost.sh +++ b/tests/15_single_ipv6_dns_localhost.sh @@ -1,6 +1,6 @@ script_type="up" -dev="tun15" -foreign_option_1="dhcp-option DNS ::1" + +foreign_options=("dhcp-option DNS ::1") TEST_TITLE="Single IPv6 DNS Server (Localhost)" TEST_BUSCTL_CALLED=1 diff --git a/tests/16_dual_ipv6_single_ipv4.sh b/tests/16_dual_ipv6_single_ipv4.sh index 7500360..3f48b36 100644 --- a/tests/16_dual_ipv6_single_ipv4.sh +++ b/tests/16_dual_ipv6_single_ipv4.sh @@ -1,7 +1,9 @@ script_type="up" -dev="tun16" -foreign_option_1="dhcp-option DNS 1234:567:89::ab:cdef" -foreign_option_2="dhcp-option DNS 1.23.4.56" + +foreign_options=( + "dhcp-option DNS 1234:567:89::ab:cdef" + "dhcp-option DNS 1.23.4.56" +) TEST_TITLE="Single IPv6 and Single IPv4 DNS Servers" TEST_BUSCTL_CALLED=1 diff --git a/tests/16a_dual_ipv6_single_ipv4.sh b/tests/16a_dual_ipv6_single_ipv4.sh index 38a96e8..6fe7dc3 100644 --- a/tests/16a_dual_ipv6_single_ipv4.sh +++ b/tests/16a_dual_ipv6_single_ipv4.sh @@ -1,7 +1,9 @@ script_type="up" -dev="tun16" -foreign_option_1="dhcp-option DNS6 1234:567:89::ab:cdef" -foreign_option_2="dhcp-option DNS 1.23.4.56" + +foreign_options=( + "dhcp-option DNS6 1234:567:89::ab:cdef" + "dhcp-option DNS 1.23.4.56" +) TEST_TITLE="Single IPv6 and Single IPv4 DNS Servers (DNS6)" TEST_BUSCTL_CALLED=1 diff --git a/tests/17_single_ipv6_single_ipv4.sh b/tests/17_single_ipv6_single_ipv4.sh index e9ca3dc..9ab7a0c 100644 --- a/tests/17_single_ipv6_single_ipv4.sh +++ b/tests/17_single_ipv6_single_ipv4.sh @@ -1,8 +1,10 @@ script_type="up" -dev="tun17" -foreign_option_1="dhcp-option DNS 1234:567:89::ab:cdef" -foreign_option_2="dhcp-option DNS 1.23.4.56" -foreign_option_3="dhcp-option DNS 20a0::1" + +foreign_options=( + "dhcp-option DNS 1234:567:89::ab:cdef" + "dhcp-option DNS 1.23.4.56" + "dhcp-option DNS 20a0::1" +) TEST_TITLE="Single IPv6 and Single IPv4 DNS Servers" TEST_BUSCTL_CALLED=1 diff --git a/tests/18_dns_ipv4_ipv6_domain_and_search.sh b/tests/18_dns_ipv4_ipv6_domain_and_search.sh index 4469b9a..782c3bf 100644 --- a/tests/18_dns_ipv4_ipv6_domain_and_search.sh +++ b/tests/18_dns_ipv4_ipv6_domain_and_search.sh @@ -1,11 +1,13 @@ script_type="up" -dev="tun18" -foreign_option_1="dhcp-option DNS 1.23.4.56" -foreign_option_2="dhcp-option DNS 2.34.56.7" -foreign_option_3="dhcp-option DNS 1234:567:89::ab:cdef" -foreign_option_4="dhcp-option DNS 1234:567:89::ba:cdef" -foreign_option_5="dhcp-option DOMAIN example.com" -foreign_option_6="dhcp-option DOMAIN-SEARCH example.co" + +foreign_options=( + "dhcp-option DNS 1.23.4.56" + "dhcp-option DNS 2.34.56.7" + "dhcp-option DNS 1234:567:89::ab:cdef" + "dhcp-option DNS 1234:567:89::ba:cdef" + "dhcp-option DOMAIN example.com" + "dhcp-option DOMAIN-SEARCH example.co" +) TEST_TITLE="DNS IPv4 and IPv6 Servers, plus Domain and Search" TEST_BUSCTL_CALLED=1 diff --git a/tests/19a_dns_invalid_ipv6.sh b/tests/19a_dns_invalid_ipv6.sh index 8175220..224dc26 100644 --- a/tests/19a_dns_invalid_ipv6.sh +++ b/tests/19a_dns_invalid_ipv6.sh @@ -1,7 +1,6 @@ source "${BASH_SOURCE[0]%/*}/helpers/ipv6.sh" script_type="up" -dev="tun19" # busctl should not be called for any test in here TEST_BUSCTL_CALLED=0 diff --git a/tests/19b_dns_valid_ipv6.sh b/tests/19b_dns_valid_ipv6.sh index 7690177..37fc7c1 100644 --- a/tests/19b_dns_valid_ipv6.sh +++ b/tests/19b_dns_valid_ipv6.sh @@ -1,7 +1,6 @@ source "${BASH_SOURCE[0]%/*}/helpers/ipv6.sh" script_type="up" -dev="tun19" TEST_BUSCTL_CALLED=1 TEST_BUSCTL_DNS=SKIP diff --git a/tests/19c_dns_invalid_ipv4.sh b/tests/19c_dns_invalid_ipv4.sh index 293b771..a5ff107 100644 --- a/tests/19c_dns_invalid_ipv4.sh +++ b/tests/19c_dns_invalid_ipv4.sh @@ -1,7 +1,6 @@ source "${BASH_SOURCE[0]%/*}/helpers/ipv4.sh" script_type="up" -dev="tun19" # busctl should not be called for any test in here TEST_BUSCTL_CALLED=0 diff --git a/tests/20_dnssec_only.sh b/tests/20_dnssec_only.sh index 80b8ee5..a99f6b8 100644 --- a/tests/20_dnssec_only.sh +++ b/tests/20_dnssec_only.sh @@ -1,5 +1,4 @@ script_type="up" -dev="tun20" TEST_BUSCTL_CALLED=1 diff --git a/tests/21_dnssec_invalid_options.sh b/tests/21_dnssec_invalid_options.sh index 9f1c0b7..074a004 100644 --- a/tests/21_dnssec_invalid_options.sh +++ b/tests/21_dnssec_invalid_options.sh @@ -1,5 +1,4 @@ script_type="up" -dev="tun21" TEST_BUSCTL_CALLED=0 EXPECT_FAILURE=1 diff --git a/tests/22_dns_dnssec_domain_and_search.sh b/tests/22_dns_dnssec_domain_and_search.sh index 8f7bb29..96a8802 100644 --- a/tests/22_dns_dnssec_domain_and_search.sh +++ b/tests/22_dns_dnssec_domain_and_search.sh @@ -1,11 +1,13 @@ script_type="up" -dev="tun22" -foreign_option_1="dhcp-option DNS 1.23.4.56" -foreign_option_2="dhcp-option DNS 1234:567:89::ab:cdef" -foreign_option_3="dhcp-option DOMAIN example.com" -foreign_option_4="dhcp-option DOMAIN-SEARCH example.org" -foreign_option_5="dhcp-option DOMAIN-ROUTE example.net" -foreign_option_6="dhcp-option DNSSEC yes" + +foreign_options=( + "dhcp-option DNS 1.23.4.56" + "dhcp-option DNS 1234:567:89::ab:cdef" + "dhcp-option DOMAIN example.com" + "dhcp-option DOMAIN-SEARCH example.org" + "dhcp-option DOMAIN-ROUTE example.net" + "dhcp-option DNSSEC yes" +) TEST_TITLE="DNS, DNSSEC, Domain, Search, and Route" TEST_BUSCTL_CALLED=1 diff --git a/tests/23_resolve1_dbus_presence.sh b/tests/23_resolve1_dbus_presence.sh index cfca38d..b6e0966 100644 --- a/tests/23_resolve1_dbus_presence.sh +++ b/tests/23_resolve1_dbus_presence.sh @@ -1,5 +1,4 @@ script_type="up" -dev="tun23" TEST_TITLE='Error if "busctl status org.freedesktop.resolve1" fails' TEST_BUSCTL_CALLED=1 diff --git a/tests/24_custom_foreign_options.sh b/tests/24_custom_foreign_options.sh index 4ff150e..3163e77 100644 --- a/tests/24_custom_foreign_options.sh +++ b/tests/24_custom_foreign_options.sh @@ -1,5 +1,4 @@ script_type="up" -dev="tun23" run_custom_foreign_option_test() { local TEST_TITLE foreign_option_1 suffix varname