]> git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests.recursor-dnssec/test_ZTC.py
Merge pull request #14257 from omoerbeek/rec-pb-more-fields
[thirdparty/pdns.git] / regression-tests.recursor-dnssec / test_ZTC.py
1 import dns
2 import time
3 import os
4 import subprocess
5
6 from recursortests import RecursorTest
7
8 class testZTC(RecursorTest):
9
10 _confdir = 'ZTC'
11 _config_template = """
12 dnssec:
13 validation: validate
14 recordcache:
15 zonetocaches:
16 - zone: .
17 method: axfr
18 sources:
19 - 193.0.14.129
20 """
21
22 @classmethod
23 def setUpClass(cls):
24
25 # we don't need all the auth stuff
26 cls.setUpSockets()
27 cls.startResponders()
28
29 confdir = os.path.join('configs', cls._confdir)
30 cls.createConfigDir(confdir)
31
32 cls.generateRecursorYamlConfig(confdir, False)
33 cls.startRecursor(confdir, cls._recursorPort)
34
35 @classmethod
36 def tearDownClass(cls):
37 cls.tearDownRecursor()
38
39 def testZTC(self):
40 grepCmd = ['grep', 'validationStatus="Secure"', 'configs/' + self._confdir + '/recursor.log']
41 ret = b''
42 for i in range(30):
43 time.sleep(1)
44 try:
45 ret = subprocess.check_output(grepCmd, stderr=subprocess.STDOUT)
46 except subprocess.CalledProcessError as e:
47 continue
48 print(b'A' + ret)
49 break
50 print(ret)
51 self.assertNotEqual(ret, b'')
52