]> git.ipfire.org Git - thirdparty/pdns.git/blame - regression-tests.recursor-dnssec/printlogs.py
Make sure we can install unsigned packages.
[thirdparty/pdns.git] / regression-tests.recursor-dnssec / printlogs.py
CommitLineData
a002923f
PL
1#!/usr/bin/env python2
2
7a0ea291 3from __future__ import print_function
a002923f
PL
4import xml.etree.ElementTree
5import os.path
6import glob
7
8e = xml.etree.ElementTree.parse('nosetests.xml')
9root = e.getroot()
10
11for 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 <==============")
42