From: Mark Andrews Date: Tue, 2 Nov 2021 04:16:17 +0000 (+1100) Subject: Check synthesis of A record from wildcard A X-Git-Tag: v9.17.21~5^2~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25915e81b4704252f02f57bc5a722845e97310c4;p=thirdparty%2Fbind9.git Check synthesis of A record from wildcard A --- diff --git a/bin/tests/system/synthfromdnssec/tests.sh b/bin/tests/system/synthfromdnssec/tests.sh index 9c644809b8a..908226351f8 100644 --- a/bin/tests/system/synthfromdnssec/tests.sh +++ b/bin/tests/system/synthfromdnssec/tests.sh @@ -51,6 +51,19 @@ check_nosynth_soa() ( return 0 ) +check_synth_a() ( + name=$(echo "$1" | sed 's/\./\\./g') + grep "^${name}.*[0-9]*.IN.A.[0-2]" ${2} > /dev/null || return 1 + grep "^${name}.*3600.IN.A.[0-2]" ${2} > /dev/null && return 1 + return 0 +) + +check_nosynth_a() ( + name=$(echo "$1" | sed 's/\./\\./g') + grep "^${name}.*3600.IN.A.[0-2]" ${2} > /dev/null || return 1 + return 0 +) + for ns in 2 4 5 do case $ns in @@ -86,7 +99,7 @@ do dig_with_opts a.wild-a.example. @10.53.0.${ns} a > dig.out.ns${ns}.test$n || ret=1 check_ad_flag yes dig.out.ns${ns}.test$n || ret=1 check_status NOERROR dig.out.ns${ns}.test$n || ret=1 - grep "a.wild-a.example.*3600.IN.A" dig.out.ns${ns}.test$n > /dev/null || ret=1 + check_nosynth_a a.wild-a.example. dig.out.ns${ns}.test$n || ret=1 n=$((n+1)) if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -164,10 +177,9 @@ do check_status NOERROR dig.out.ns${ns}.test$n || ret=1 if [ ${synth} = yes ] then - grep "b\.wild-a\.example\..*IN.A" dig.out.ns${ns}.test$n > /dev/null || ret=1 - grep "b\.wild-a\.example\..*3600.IN.A" dig.out.ns${ns}.test$n > /dev/null && ret=1 + check_synth_a b.wild-a.example. dig.out.ns${ns}.test$n || ret=1 else - grep "b\.wild-a\.example\..*3600.IN.A" dig.out.ns${ns}.test$n > /dev/null || ret=1 + check_nosynth_a b.wild-a.example. dig.out.ns${ns}.test$n || ret=1 fi n=$((n+1)) if [ $ret != 0 ]; then echo_i "failed"; fi