]> git.proxmox.com Git - ceph.git/blame - ceph/src/Beast/scripts/parseautobahn.py
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / Beast / scripts / parseautobahn.py
CommitLineData
7c673cae
FG
1import os
2import json
3import sys
4
5VARIANT = os.environ.get('VARIANT', 'release')
6EXPECTED_BEHAVIOR = ('OK', 'UNIMPLEMENTED', 'INFORMATIONAL')
7EXPECTED_BEHAVIOR_CLOSE = ('OK', 'INFORMATIONAL')
8WARNINGS = ("peer did not respond (in time) in closing handshake", )
9
10args = sys.argv[1:]
11fn = os.path.abspath(args[0])
12indexPath = os.path.dirname(fn)
13relativeToIndex = lambda f: os.path.join(indexPath, f)
14print "index", fn
15
16
17failures = []
18warnings = []
19
20with open(fn, 'r') as fh:
21 index = json.load(fh)
22 for servername, serverResults in index.items():
23 for test in serverResults:
24 result = serverResults[test]
25 if ((result['behavior'] not in EXPECTED_BEHAVIOR) or
26 result['behaviorClose'] not in EXPECTED_BEHAVIOR_CLOSE):
27 with open(relativeToIndex(result['reportfile'])) as rh:
28 report = json.load(rh)
29 if (report.get('wasNotCleanReason', '') in WARNINGS and
30 VARIANT != 'release'):
31 warnings.append(report)
32 else:
33 failures.append(report)
34
35
36if warnings:
37 print >> sys.stderr, json.dumps(warnings, indent=2)
38 print >> sys.stderr, 'there was %s warnings' % len(warnings)
39
40if failures:
41 print >> sys.stderr, json.dumps(failures, indent=2)
42 print >> sys.stderr, 'there was %s failures' % len(failures)
43 sys.exit(1)