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