]> git.ipfire.org Git - thirdparty/pdns.git/blame - regression-tests/bulktest-report.py
dnsdist doc typo fix
[thirdparty/pdns.git] / regression-tests / bulktest-report.py
CommitLineData
cacbf70c 1#!/usr/bin/env python
7a0ea291 2from __future__ import print_function
cacbf70c
PD
3import json, sys
4
5runs = json.load(sys.stdin)
6
c885fb84 7selectors = dict(s.split('=',1) for s in sys.argv[1:])
cacbf70c
PD
8
9selected=list()
10
11names=set()
12
13for run in runs:
14 match = True
c885fb84 15 for k,v in selectors.iteritems():
cacbf70c
PD
16 # print k, v, run[k]
17 if run[k] != v:
18 match = False
19 break
20
21 if match:
22 selected.append((run['tag'], run))
23 names.update(run)
24
25selected.sort()
26
27names.discard('tag')
28
bb027ace 29fmt=''.join('%%%ds' % max(15, i+4) for i in [3]+map(len, sorted(names)))
7a0ea291 30print(fmt % tuple(['tag']+sorted(names)))
cacbf70c 31for tag, stats in selected:
7a0ea291 32 print(fmt % tuple([tag] + [stats.get(s) for s in sorted(names)]))