2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Check synthesis of A record from wildcard A

This commit is contained in:
Mark Andrews
2021-11-02 15:16:17 +11:00
committed by Petr Špaček
parent b8563db96a
commit 25915e81b4

View File

@@ -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