]>
git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests.recursor-dnssec/test_SimpleDoT.py
4 from recursortests
import RecursorTest
6 class testSimpleDoT(RecursorTest
):
8 This tests DoT to auth server in a very basic way and is dependent on powerdns.com nameservers having DoT enabled.
11 _confdir
= 'SimpleDoT'
12 _config_template
= """
14 dot-to-auth-names=powerdns.com
15 devonly-regression-test-mode
23 # we don't need all the auth stuff
27 confdir
= os
.path
.join('configs', cls
._confdir
)
28 cls
.createConfigDir(confdir
)
30 cls
.generateRecursorConfig(confdir
)
31 cls
.startRecursor(confdir
, cls
._recursorPort
)
34 expected
= dns
.rrset
.from_text('dot-test-target.powerdns.org.', 0, dns
.rdataclass
.IN
, 'TXT', 'https://github.com/PowerDNS/pdns/pull/12825')
35 query
= dns
.message
.make_query('dot-test-target.powerdns.org', 'TXT', want_dnssec
=True)
36 query
.flags |
= dns
.flags
.AD
38 res
= self
.sendUDPQuery(query
)
40 self
.assertMessageIsAuthenticated(res
)
41 self
.assertRRsetInAnswer(res
, expected
)
42 self
.assertMatchingRRSIGInAnswer(res
, expected
)
44 rec_controlCmd
= [os
.environ
['RECCONTROL'],
45 '--config-dir=%s' % 'configs/' + self
._confdir
,
48 ret
= subprocess
.check_output(rec_controlCmd
, stderr
=subprocess
.STDOUT
)
49 self
.assertNotEqual(ret
, b
'UNKNOWN\n')
50 self
.assertNotEqual(ret
, b
'0\n')
52 except subprocess
.CalledProcessError
as e
:
56 rec_controlCmd
= [os
.environ
['RECCONTROL'],
57 '--config-dir=%s' % 'configs/' + self
._confdir
,
60 ret
= subprocess
.check_output(rec_controlCmd
, stderr
=subprocess
.STDOUT
)
61 self
.assertEqual(ret
, b
'0\n')
63 except subprocess
.CalledProcessError
as e
: