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