]>
Commit | Line | Data |
---|---|---|
5e7b9606 OM |
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=validate | |
13 | """ | |
14 | _lua_config_file = """ | |
15 | zoneToCache(".", "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 |