]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add source port configuration tests
authorEvan Hunt <each@isc.org>
Thu, 2 Feb 2023 21:35:32 +0000 (13:35 -0800)
committerEvan Hunt <each@isc.org>
Mon, 6 Feb 2023 23:03:58 +0000 (15:03 -0800)
check in the log files of receiving servers that the originating
ports for notify and SOA query messages were set correctly from
configured notify-source and transfer-source options.

bin/tests/system/notify/ns2/named.conf.in
bin/tests/system/notify/tests.sh
bin/tests/system/xfer/ns3/named.conf.in
bin/tests/system/xfer/tests.sh

index 44aac9501373da876098a5b62f06b95852de74ca..abfdc102e2ccde98f6b63af25d9dcd89d28293c4 100644 (file)
@@ -51,16 +51,17 @@ primaries noport { 10.53.0.4; };
 masters x21 port @EXTRAPORT1@ { noport; };
 
 zone x1 {
-    type primary;
+       type primary;
        file "generic.db";
        also-notify { 10.53.0.3; };
-    notify primary-only;
+       notify-source 10.53.0.2 port @EXTRAPORT2@;
+       notify primary-only;
 };
 zone x2 {
-    type primary;
+       type primary;
        file "generic.db";
        also-notify { 10.53.0.3; };
-    notify master-only; # test old syntax
+       notify master-only; # test old syntax
 };
 
 zone x3 { type primary; file "generic.db"; also-notify { 10.53.0.3; }; };
index 748c1072174abbc14edbdfa510cb5275a8e69bb7..dad89bd7480b476d1729312421e4a0e20d3dbc9c 100644 (file)
@@ -202,6 +202,10 @@ grep "sending notify to 10.53.0.5#[0-9]* : TSIG (b)" ns5/named.run > /dev/null |
 grep "sending notify to 10.53.0.5#[0-9]* : TSIG (c)" ns5/named.run > /dev/null || ret=1
 test_end
 
+test_start "checking notify-source uses port option correctly"
+grep "10.53.0.2#${EXTRAPORT2}: received notify for zone 'x1'" ns3/named.run > /dev/null || ret=1
+test_end
+
 # notify messages were sent to unresponsive 10.53.10.53 during the tests
 # above, which should time out at some point; we need to wait for them to
 # appear in the logs in case the tests run faster than the notify timeouts
index 76f19b56141571dbeed221958973acacd68b75e1..426c008f10c12f8e4803fe7969095173610797db 100644 (file)
@@ -50,6 +50,7 @@ zone "example" {
 
 zone "primary" {
        type secondary;
+        transfer-source 10.53.0.3 port @EXTRAPORT1@;
        primaries { 10.53.0.6; };
        file "primary.bk";
 };
index 49581a046b3c44d497ab4559609bba1a0f1e77d7..7ff58c7bd04b46caeca93d0a47e88122cbea41c3 100755 (executable)
@@ -573,5 +573,12 @@ retry_quiet 10 check_xfer_stats || tmp=1
 if test $tmp != 0 ; then echo_i "failed"; fi
 status=$((status+tmp))
 
+n=$((n+1))
+echo_i "test that transfer-source uses port option correctly ($n)"
+tmp=0
+grep "10.53.0.3#${EXTRAPORT1} (primary): query 'primary/SOA/IN' approved" ns6/named.run > /dev/null || ret=1
+if test $tmp != 0 ; then echo_i "failed"; fi
+status=$((status+tmp))
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1