]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Added test to verify that both include glob-expression and include
authorDiego Fronza <diego@isc.org>
Tue, 22 Oct 2019 13:43:24 +0000 (10:43 -0300)
committerDiego Fronza <diego@isc.org>
Mon, 24 Feb 2020 16:37:55 +0000 (13:37 -0300)
non-glob-expression works.

bin/tests/system/include-multiplecfg/ns2/mars.com.db [new file with mode: 0644]
bin/tests/system/include-multiplecfg/ns2/mars.conf [new file with mode: 0644]
bin/tests/system/include-multiplecfg/ns2/named.conf.in
bin/tests/system/include-multiplecfg/ns2/zone1.com.db
bin/tests/system/include-multiplecfg/ns2/zone1.conf
bin/tests/system/include-multiplecfg/ns2/zone2.com.db
bin/tests/system/include-multiplecfg/ns2/zone2.conf
bin/tests/system/include-multiplecfg/tests.sh

diff --git a/bin/tests/system/include-multiplecfg/ns2/mars.com.db b/bin/tests/system/include-multiplecfg/ns2/mars.com.db
new file mode 100644 (file)
index 0000000..c0b6082
--- /dev/null
@@ -0,0 +1,13 @@
+$TTL 86400
+@     IN     SOA    dns1.mars.com.     hostmaster.mars.com. (
+                    2001062501 ; serial
+                    21600      ; refresh after 6 hours
+                    3600       ; retry after 1 hour
+                    604800     ; expire after 1 week
+                    86400 )    ; minimum TTL of 1 day
+
+      IN     NS     dns1.mars.com.
+
+             IN     A       10.53.0.1
+
+dns1         IN     A       10.53.0.1
diff --git a/bin/tests/system/include-multiplecfg/ns2/mars.conf b/bin/tests/system/include-multiplecfg/ns2/mars.conf
new file mode 100644 (file)
index 0000000..b7af878
--- /dev/null
@@ -0,0 +1,6 @@
+
+zone "mars.com" {
+        type master;
+        file "mars.com.db";
+};
+
index 4ae6ac1c631dae7a35f9db050b74738c2bd50987..5386f975235e97990c7c9d279f23ada1b350f651 100644 (file)
@@ -18,10 +18,9 @@ options {
         notify no;
 };
 
-#zone "." {
-#        type hint;
-#        file "../../common/root.hint";
-#};
-
+# Should include all files matching pattern.
 include "zone*.conf";
 
+# Shouldn't break standard file pattern.
+include "mars.conf";
+
index c7836be37b598761546f281df5a70024c7b07dad..17e932f5667c113abadc8c00865081574ef6af2c 100644 (file)
@@ -7,15 +7,7 @@ $TTL 86400
                     86400 )    ; minimum TTL of 1 day
 
       IN     NS     dns1.zone1.com.
-      IN     NS     dns2.zone1.com.
-
-      IN     MX     10     mail1.zone1.com.
-      IN     MX     20     mail2.zone1.com.
 
              IN     A       10.53.0.1
 
 dns1         IN     A       10.53.0.1
-dns2         IN     A       10.53.0.2
-
-mail1        IN     A       10.53.0.1
-mail2        IN     A       10.53.0.2
index fe903bc0c96fcc9d058be4d9ee86fd13d0c83e94..8dcae426cf5139c2d16c39c2da6b28204ca5030d 100644 (file)
@@ -2,7 +2,5 @@
 zone "zone1.com" {
         type master;
         file "zone1.com.db";
-        allow-transfer { any; };
-        allow-update { any; };
 };
 
index 4a08fa7cecc0767b27907c210b681ec7276fd311..dc46098952fcd8a43949cbdd9400f6e3ea2cbffc 100644 (file)
@@ -7,15 +7,7 @@ $TTL 86400
                     86400 )    ; minimum TTL of 1 day
 
       IN     NS     dns1.zone2.com.
-      IN     NS     dns2.zone2.com.
-
-      IN     MX     10     mail1.zone2.com.
-      IN     MX     20     mail2.zone2.com.
 
              IN     A       10.53.0.1
 
 dns1         IN     A       10.53.0.1
-dns2         IN     A       10.53.0.2
-
-mail1        IN     A       10.53.0.1
-mail2        IN     A       10.53.0.2
index 4bbd56eea7518da359ec1e84671a80d1f4bf42a5..bb995b64f02b38cc32ed034c17460fd69f8ad0bb 100644 (file)
@@ -2,7 +2,5 @@
 zone "zone2.com" {
         type master;
         file "zone2.com.db";
-        allow-transfer { any; };
-        allow-update { any; };
 };
 
index 9de935b5e05ada3ee2a737319f44e325a9d70636..d5c37caaa654a61262bfa94372112f6ee0303c85 100644 (file)
@@ -22,7 +22,7 @@ n=0
 
 # Test 1 - check if zone1 was loaded.
 n=`expr $n + 1`
-echo_i "test $n: glob include zone1"
+echo_i "checking glob include of zone1 config ($n)"
 ret=0
 $DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 zone1.com. a > dig.out.ns2.$n || ret=1
 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
@@ -32,7 +32,7 @@ status=`expr $status + $ret`
 
 # Test 2 - check if zone2 was loaded.
 n=`expr $n + 1`
-echo_i "test $n: glob include zone2"
+echo_i "checking glob include of zone2 config ($n)"
 ret=0
 $DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 zone2.com. a > dig.out.ns2.$n || ret=1
 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
@@ -40,5 +40,15 @@ grep '^zone2.com.' dig.out.ns2.$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+# Test 3 - check if standard file path (no magic chars) works.
+n=`expr $n + 1`
+echo_i "checking include of standard file path config ($n)"
+ret=0
+$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 mars.com. a > dig.out.ns2.$n || ret=1
+grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
+grep '^mars.com.' dig.out.ns2.$n > /dev/null || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1