From: Otto Moerbeek Date: Fri, 6 Sep 2024 11:29:17 +0000 (+0200) Subject: Add basic chain test that hits the case of #14624 X-Git-Tag: rec-5.2.0-alpha1~95^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=44b1de9830c4c8d7ceec86799c1bdb5a670d3d3e;p=thirdparty%2Fpdns.git Add basic chain test that hits the case of #14624 We do rely on that OS queueing the UDP packets, hope it will do so long enough --- diff --git a/regression-tests.recursor-dnssec/test_Chain.py b/regression-tests.recursor-dnssec/test_Chain.py new file mode 100644 index 0000000000..8cf08f6459 --- /dev/null +++ b/regression-tests.recursor-dnssec/test_Chain.py @@ -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)