]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Split the first masterfile test into 3
authorMark Andrews <marka@isc.org>
Tue, 27 Feb 2024 04:42:06 +0000 (15:42 +1100)
committerMark Andrews <marka@isc.org>
Wed, 28 Feb 2024 01:26:31 +0000 (12:26 +1100)
Additionally read the correct zone for BIND 8 ttl checks

(cherry picked from commit e02b73c7a4413353b3c6ac3410a09dacd4cfb242)

.reuse/dep5
bin/tests/system/masterfile/knowngood.dig.out [deleted file]
bin/tests/system/masterfile/knowngood.include [new file with mode: 0644]
bin/tests/system/masterfile/knowngood.ttl1 [new file with mode: 0644]
bin/tests/system/masterfile/knowngood.ttl2 [new file with mode: 0644]
bin/tests/system/masterfile/tests.sh

index 39ece7deaa2ce5ebe6eef0ab1d96de20ea2fa228..298419a0123232bd1be646715b60b5f10e6a2264 100644 (file)
@@ -57,6 +57,9 @@ Files: **/README
        bin/tests/system/keepalive/expected
        bin/tests/system/legacy/ns6/edns512.db.signed
        bin/tests/system/legacy/ns7/edns512-notcp.db.signed
+       bin/tests/system/masterfile/knowngood.include
+       bin/tests/system/masterfile/knowngood.ttl1
+       bin/tests/system/masterfile/knowngood.ttl2
        bin/tests/system/notify/ns4/named.port.in
        bin/tests/system/nsupdate/commandlist
        bin/tests/system/nsupdate/verylarge.in
diff --git a/bin/tests/system/masterfile/knowngood.dig.out b/bin/tests/system/masterfile/knowngood.dig.out
deleted file mode 100644 (file)
index d4cbac8..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-include.               300     IN      SOA     ns.include. hostmaster.include. 1 3600 1800 1814400 3600
-include.               300     IN      NS      ns.include.
-a.include.             300     IN      A       10.0.0.1
-a.include.             300     IN      A       10.0.0.99
-a.a.include.           300     IN      A       10.0.1.1
-b.foo.a.include.       300     IN      A       10.0.2.2
-b.include.             300     IN      A       10.0.0.2
-a.b.include.           300     IN      A       10.0.1.1
-c.b.include.           300     IN      A       10.0.0.3
-b.foo.b.include.       300     IN      A       10.0.2.2
-ns.include.            300     IN      A       127.0.0.1
-include.               300     IN      SOA     ns.include. hostmaster.include. 1 3600 1800 1814400 3600
-ttl2.                  1       IN      SOA     ns.ttl2. hostmaster.ttl2. 1 3600 1800 1814400 3
-ttl2.                  1       IN      NS      ns.ttl2.
-a.ttl2.                        1       IN      TXT     "inherited ttl 1"
-b.ttl2.                        2       IN      TXT     "explicit ttl 2"
-c.ttl2.                        2       IN      TXT     "inherited ttl 2"
-d.ttl2.                        3       IN      TXT     "default ttl 3"
-e.ttl2.                        2       IN      TXT     "explicit ttl 2"
-f.ttl2.                        3       IN      TXT     "default ttl 3"
-ns.ttl2.               1       IN      A       10.53.0.1
-ttl2.                  1       IN      SOA     ns.ttl2. hostmaster.ttl2. 1 3600 1800 1814400 3
-ttl2.                  1       IN      SOA     ns.ttl2. hostmaster.ttl2. 1 3600 1800 1814400 3
-ttl2.                  1       IN      NS      ns.ttl2.
-a.ttl2.                        1       IN      TXT     "inherited ttl 1"
-b.ttl2.                        2       IN      TXT     "explicit ttl 2"
-c.ttl2.                        2       IN      TXT     "inherited ttl 2"
-d.ttl2.                        3       IN      TXT     "default ttl 3"
-e.ttl2.                        2       IN      TXT     "explicit ttl 2"
-f.ttl2.                        3       IN      TXT     "default ttl 3"
-ns.ttl2.               1       IN      A       10.53.0.1
-ttl2.                  1       IN      SOA     ns.ttl2. hostmaster.ttl2. 1 3600 1800 1814400 3
diff --git a/bin/tests/system/masterfile/knowngood.include b/bin/tests/system/masterfile/knowngood.include
new file mode 100644 (file)
index 0000000..795cc34
--- /dev/null
@@ -0,0 +1,12 @@
+include.               300     IN      SOA     ns.include. hostmaster.include. 1 3600 1800 1814400 3600
+include.               300     IN      NS      ns.include.
+a.include.             300     IN      A       10.0.0.1
+a.include.             300     IN      A       10.0.0.99
+a.a.include.           300     IN      A       10.0.1.1
+b.foo.a.include.       300     IN      A       10.0.2.2
+b.include.             300     IN      A       10.0.0.2
+a.b.include.           300     IN      A       10.0.1.1
+c.b.include.           300     IN      A       10.0.0.3
+b.foo.b.include.       300     IN      A       10.0.2.2
+ns.include.            300     IN      A       127.0.0.1
+include.               300     IN      SOA     ns.include. hostmaster.include. 1 3600 1800 1814400 3600
diff --git a/bin/tests/system/masterfile/knowngood.ttl1 b/bin/tests/system/masterfile/knowngood.ttl1
new file mode 100644 (file)
index 0000000..86baa95
--- /dev/null
@@ -0,0 +1,10 @@
+ttl1.                  3       IN      SOA     ns.ttl1. hostmaster.ttl1. 1 3600 1800 1814400 3
+ttl1.                  3       IN      NS      ns.ttl1.
+a.ttl1.                        3       IN      TXT     "soa minttl 3"
+b.ttl1.                        2       IN      TXT     "explicit ttl 2"
+c.ttl1.                        3       IN      TXT     "soa minttl 3"
+d.ttl1.                        1       IN      TXT     "default ttl 1"
+e.ttl1.                        4       IN      TXT     "explicit ttl 4"
+f.ttl1.                        1       IN      TXT     "default ttl 1"
+ns.ttl1.               3       IN      A       10.53.0.1
+ttl1.                  3       IN      SOA     ns.ttl1. hostmaster.ttl1. 1 3600 1800 1814400 3
diff --git a/bin/tests/system/masterfile/knowngood.ttl2 b/bin/tests/system/masterfile/knowngood.ttl2
new file mode 100644 (file)
index 0000000..2f2a9f9
--- /dev/null
@@ -0,0 +1,10 @@
+ttl2.                  1       IN      SOA     ns.ttl2. hostmaster.ttl2. 1 3600 1800 1814400 3
+ttl2.                  1       IN      NS      ns.ttl2.
+a.ttl2.                        1       IN      TXT     "inherited ttl 1"
+b.ttl2.                        2       IN      TXT     "explicit ttl 2"
+c.ttl2.                        2       IN      TXT     "inherited ttl 2"
+d.ttl2.                        3       IN      TXT     "default ttl 3"
+e.ttl2.                        2       IN      TXT     "explicit ttl 2"
+f.ttl2.                        3       IN      TXT     "default ttl 3"
+ns.ttl2.               1       IN      A       10.53.0.1
+ttl2.                  1       IN      SOA     ns.ttl2. hostmaster.ttl2. 1 3600 1800 1814400 3
index 2502691ff8d8b67b3ed21552c767e63bc253dba4..edfb338395fa1c03d8c6cfccc18f2d5ed9c2489e 100644 (file)
@@ -24,13 +24,25 @@ n=$(expr $n + 1)
 echo_i "test master file \$INCLUDE semantics ($n)"
 $DIG $DIGOPTS +nostats +nocmd include. axfr @10.53.0.1 >dig.out.$n || ret=1
 
+$DIFF dig.out.$n knowngood.include || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
+ret=0
+n=$((n + 1))
 echo_i "test master file BIND 8 compatibility TTL and \$TTL semantics ($n)"
-$DIG $DIGOPTS +nostats +nocmd ttl2. axfr @10.53.0.1 >>dig.out.$n || ret=1
+$DIG $DIGOPTS +nostats +nocmd ttl1. axfr @10.53.0.1 >dig.out.$n || ret=1
 
+$DIFF dig.out.$n knowngood.ttl1 || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=$((status + ret))
+
+ret=0
+n=$((n + 1))
 echo_i "test of master file RFC1035 TTL and \$TTL semantics ($n)"
-$DIG $DIGOPTS +nostats +nocmd ttl2. axfr @10.53.0.1 >>dig.out.$n || ret=1
+$DIG $DIGOPTS +nostats +nocmd ttl2. axfr @10.53.0.1 >dig.out.$n || ret=1
 
-$DIFF dig.out.$n knowngood.dig.out || status=1
+$DIFF dig.out.$n knowngood.ttl2 || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$(expr $status + $ret)