]>
git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests.recursor-dnssec/test_OOOTCP.py
4 from recursortests
import RecursorTest
6 class testOOOTCP(RecursorTest
):
9 _config_template
= """dnssec=validate
13 def generateRecursorConfig(cls
, confdir
):
14 super(testOOOTCP
, cls
).generateRecursorConfig(confdir
)
16 def testOOOVeryBasic(self
):
19 for zone
in ['5.delay1.example.', '0.delay2.example.']:
20 expected
[zone
] = dns
.rrset
.from_text(zone
, 0, dns
.rdataclass
.IN
, 'TXT', 'a')
21 query
= dns
.message
.make_query(zone
, 'TXT', want_dnssec
=True)
22 query
.flags |
= dns
.flags
.AD
25 ress
= self
.sendTCPQueries(queries
)
27 self
.assertEqual(len(ress
), len(expected
))
30 for exp
in [expected
['0.delay2.example.'], expected
['5.delay1.example.']]:
32 print(ress
[i
].answer
[0].to_text())
35 self
.assertMessageIsAuthenticated(ress
[i
])
36 self
.assertRRsetInAnswer(ress
[i
], exp
)
37 self
.assertMatchingRRSIGInAnswer(ress
[i
], exp
)
40 def testOOOTimeout(self
):
43 for zone
in ['25.delay1.example.', '1.delay2.example.']:
44 query
= dns
.message
.make_query(zone
, 'TXT', want_dnssec
=True)
45 query
.flags |
= dns
.flags
.AD
48 ress
= self
.sendTCPQueries(queries
)
50 self
.assertEqual(len(ress
), 2)
51 exp
= dns
.rrset
.from_text('1.delay2.example.', 0, dns
.rdataclass
.IN
, 'TXT', 'a')
52 self
.assertRRsetInAnswer(ress
[0], exp
)
53 self
.assertMatchingRRSIGInAnswer(ress
[0], exp
)
54 self
.assertRcodeEqual(ress
[1], dns
.rcode
.SERVFAIL
)
56 # Let the auth timeout happen to not disturb other tests
57 # this can happen if the auth is single-threaded