]>
git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests.recursor-dnssec/printlogs.py
3 from __future__
import print_function
4 import xml
.etree
.ElementTree
8 e
= xml
.etree
.ElementTree
.parse('pytest.xml')
15 if elem
.tag
in ["failure", "error"]:
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
))
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")
27 if os
.path
.exists(recursorlog
):
28 print("==============> %s <==============" % recursorlog
)
29 with
open(recursorlog
) as f
:
30 print(''.join(f
.readlines()))
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 <==============")
41 print("==============> END STDOUT LOG FROM XML <==============")