]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Make notify source port test reliable
authorMark Andrews <marka@isc.org>
Thu, 9 Feb 2023 04:11:24 +0000 (15:11 +1100)
committerMark Andrews <marka@isc.org>
Thu, 9 Feb 2023 04:11:24 +0000 (15:11 +1100)
Send the test message from ns3 to ns2 instead of ns2 to ns3 as ns2
is started first and therefore the test doesn't have to wait on the
resend of the the NOTIFY message to be successful.

bin/tests/system/notify/ns3/named.conf.in
bin/tests/system/notify/ns3/notify-source-port-test.db [new file with mode: 0644]
bin/tests/system/notify/tests.sh

index 406418e8f3359f006bdfc1d89720c69611167926..687d9f1b2c0a8e0674adc71399282b746e1bd658 100644 (file)
@@ -35,3 +35,9 @@ zone "example" {
        # non-responsive notify recipient (no reply, no ICMP errors)
        also-notify { 10.53.10.53; };
 };
+
+zone "notify-source-port-test" {
+       type primary;
+       file "notify-source-port-test.db";
+       notify-source 10.53.0.3 port @EXTRAPORT2@;
+};
diff --git a/bin/tests/system/notify/ns3/notify-source-port-test.db b/bin/tests/system/notify/ns3/notify-source-port-test.db
new file mode 100644 (file)
index 0000000..221fca1
--- /dev/null
@@ -0,0 +1,22 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; SPDX-License-Identifier: MPL-2.0
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0.  If a copy of the MPL was not distributed with this
+; file, you can obtain one at https://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+notify-source-port-test.       SOA     mname1. . (
+                                       1          ; serial
+                                       300        ; refresh (300 seconds)
+                                       300        ; retry (300 seconds)
+                                       1814400    ; expire (3 weeks)
+                                       3600       ; minimum (1 hour)
+                               )
+notify-source-port-test.       NS      ns2.notify-source-port-test.
+ns2.notify-source-port-test.   A       10.53.0.2
+notify-source-port-test.       NS      ns3.notify-source-port-test.
+ns3.notify-source-port-test.   A       10.53.0.3
index dad89bd7480b476d1729312421e4a0e20d3dbc9c..a96d59cb57f08f39084dc1f31f7ab743d37c4663 100644 (file)
@@ -203,7 +203,7 @@ grep "sending notify to 10.53.0.5#[0-9]* : TSIG (c)" ns5/named.run > /dev/null |
 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
+grep "10.53.0.3#${EXTRAPORT2}: received notify for zone 'notify-source-port-test'" ns2/named.run > /dev/null || ret=1
 test_end
 
 # notify messages were sent to unresponsive 10.53.10.53 during the tests