]> granicus.if.org Git - pdns/commitdiff
Add script to print logs after failure
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 31 May 2016 08:15:45 +0000 (10:15 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 7 Jun 2016 09:17:34 +0000 (11:17 +0200)
build-scripts/test-recursor
regression-tests.recursor-dnssec/printlogs.py [new file with mode: 0755]

index 608775c5a6282932c1aaf7468bb11875e489ce33..b80c7cc7b86c6c8cb37a229c4da5185c09c74e26 100755 (executable)
@@ -51,5 +51,6 @@ sleep 3
 
 cd ../regression-tests.recursor-dnssec
 ./runtests || EXIT=1
+./printlogs.py || true
 
 exit $EXIT
diff --git a/regression-tests.recursor-dnssec/printlogs.py b/regression-tests.recursor-dnssec/printlogs.py
new file mode 100755 (executable)
index 0000000..1267ba5
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/env python2
+
+import xml.etree.ElementTree
+import os.path
+import glob
+
+e = xml.etree.ElementTree.parse('nosetests.xml')
+root = e.getroot()
+
+for child in root:
+    if len(child):
+        for elem in child:
+            if elem.tag in ["failure", "error"]:
+                confdirname = child.get("classname").split('_')[1].split('.')[0]
+                confdir = os.path.join("configs", confdirname)
+                recursorlog = os.path.join(confdir, "recursor.log")
+                if os.path.exists(recursorlog):
+                    print "==============> %s <==============" % recursorlog
+                    with open(recursorlog) as f:
+                        print ''.join(f.readlines())
+                authdirs = glob.glob(os.path.join(confdir, "auth-*"))
+                for authdir in authdirs:
+                    authlog = os.path.join(authdir, "pdns.log")
+                    if os.path.exists(recursorlog):
+                        print "==============> %s <==============" % authlog
+                        with open(authlog) as f:
+                            print ''.join(f.readlines())