]> git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests.recursor-dnssec/test_WellKnown.py
Merge pull request #13181 from rgacogne/fix-provenance
[thirdparty/pdns.git] / regression-tests.recursor-dnssec / test_WellKnown.py
1 import dns
2 from recursortests import RecursorTest
3
4 class TestWellKnown(RecursorTest):
5 _auths_zones = None
6 _confdir = 'WellKnown'
7 _roothints = None
8 _root_DS = None
9 _config_template = """dnssec=validate"""
10
11 def testServFail(self):
12 names = ['servfail.nl', 'dnssec-failed.org']
13 results = []
14 for name in names:
15 query = dns.message.make_query(name, 'SOA')
16 results.append(self.sendUDPQuery(query, timeout=5.0))
17
18 self.assertEqual(len(results), len(names))
19
20 for result in results:
21 self.assertRcodeEqual(result, dns.rcode.SERVFAIL)
22
23 def testNoError(self):
24 names = ['powerdns.com', 'nlnetlabs.nl', 'knot-dns.cz']
25 results = []
26 for name in names:
27 query = dns.message.make_query(name, 'SOA')
28 results.append(self.sendUDPQuery(query))
29
30 self.assertEqual(len(results), len(names))
31
32 for result in results:
33 self.assertRcodeEqual(result, dns.rcode.NOERROR)