]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check synthesis of A record from wildcard A
authorMark Andrews <marka@isc.org>
Tue, 2 Nov 2021 04:16:17 +0000 (15:16 +1100)
committerPetr Špaček <pspacek@isc.org>
Thu, 2 Dec 2021 13:18:40 +0000 (14:18 +0100)
bin/tests/system/synthfromdnssec/tests.sh

index 9c644809b8a00a937a817934a4b626dbed98f51f..908226351f85a7b2bae07d1d0eca041de10de53c 100644 (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