]>
Commit | Line | Data |
---|---|---|
2f08b8d6 | 1 | #!/usr/bin/env python3 |
a002923f | 2 | |
7a0ea291 | 3 | from __future__ import print_function |
a002923f PL |
4 | import xml.etree.ElementTree |
5 | import os.path | |
6 | import glob | |
7 | ||
32d02dba | 8 | e = xml.etree.ElementTree.parse('pytest.xml') |
a002923f PL |
9 | root = e.getroot() |
10 | ||
11 | for child in root: | |
12 | if len(child): | |
e593a398 | 13 | getstdout = False |
a002923f PL |
14 | for elem in child: |
15 | if elem.tag in ["failure", "error"]: | |
e593a398 OM |
16 | cls = child.get("classname") |
17 | name = child.get("name") | |
18 | if '_' not in cls or '.' not in cls: | |
19 | print('Unexpected classname %s; name %s' % (cls, name)) | |
20 | getstdout = True | |
21 | continue | |
22 | ||
23 | confdirnames = [cls.split('_')[1].split('.')[0], cls.split('.')[1].split('Test')[0]] | |
24 | for confdirname in confdirnames: | |
25 | confdir = os.path.join("configs", confdirname) | |
26 | recursorlog = os.path.join(confdir, "recursor.log") | |
a002923f | 27 | if os.path.exists(recursorlog): |
e593a398 OM |
28 | print("==============> %s <==============" % recursorlog) |
29 | with open(recursorlog) as f: | |
7a0ea291 | 30 | print(''.join(f.readlines())) |
e593a398 OM |
31 | authdirs = glob.glob(os.path.join(confdir, "auth-*")) |
32 | for authdir in authdirs: | |
33 | authlog = os.path.join(authdir, "pdns.log") | |
34 | if os.path.exists(recursorlog): | |
35 | print("==============> %s <==============" % authlog) | |
36 | with open(authlog) as f: | |
37 | print(''.join(f.readlines())) | |
38 | if getstdout and elem.tag == 'system-out': | |
39 | print("==============> STDOUT LOG FROM XML <==============") | |
40 | print(elem.text) | |
41 | print("==============> END STDOUT LOG FROM XML <==============") |