]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add basic chain test that hits the case of #14624
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 6 Sep 2024 11:29:17 +0000 (13:29 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 15 Oct 2024 12:27:05 +0000 (14:27 +0200)
We do rely on that OS queueing the UDP packets, hope it will do so long enough

(cherry picked from commit 44b1de9830c4c8d7ceec86799c1bdb5a670d3d3e)

regression-tests.recursor-dnssec/test_Chain.py [new file with mode: 0644]

diff --git a/regression-tests.recursor-dnssec/test_Chain.py b/regression-tests.recursor-dnssec/test_Chain.py
new file mode 100644 (file)
index 0000000..8cf08f6
--- /dev/null
@@ -0,0 +1,37 @@
+import dns
+import os
+import time
+from recursortests import RecursorTest
+
+class ChainTest(RecursorTest):
+    """
+    These regression tests test the chaining of outgoing requests.
+    """
+    _confdir = 'Chain'
+
+    _config_template = """dnssec=validate
+"""
+
+    def testBasic(self):
+        """
+        Tests the case of #14624. Sending many equal requests could lead to ServFail because of clashing
+        waiter ids.
+        """
+        count = 500
+        name = '1.delay1.example.'
+        exp = dns.rrset.from_text(name, 0, dns.rdataclass.IN, 'TXT', 'a')
+        for i in range(count):
+            query = dns.message.make_query(name, 'TXT', want_dnssec=True)
+            query.flags |= dns.flags.AD
+            self._sock.send(query.to_wire())
+
+        for i in range(count):
+            print(i)
+            self._sock.settimeout(5.0)
+            data = self._sock.recv(4096)
+            res = dns.message.from_wire(data)
+            self.assertRcodeEqual(res, dns.rcode.NOERROR)
+            self.assertMessageIsAuthenticated(res)
+            self.assertRRsetInAnswer(res, exp)
+            self.assertMatchingRRSIGInAnswer(res, exp)
+        self._sock.settimeout(None)