]>
git.proxmox.com Git - ceph.git/blob - ceph/src/Beast/scripts/parseautobahn.py
5 VARIANT
= os
.environ
.get('VARIANT', 'release')
6 EXPECTED_BEHAVIOR
= ('OK', 'UNIMPLEMENTED', 'INFORMATIONAL')
7 EXPECTED_BEHAVIOR_CLOSE
= ('OK', 'INFORMATIONAL')
8 WARNINGS
= ("peer did not respond (in time) in closing handshake", )
11 fn
= os
.path
.abspath(args
[0])
12 indexPath
= os
.path
.dirname(fn
)
13 relativeToIndex
= lambda f
: os
.path
.join(indexPath
, f
)
20 with
open(fn
, 'r') as 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
)
33 failures
.append(report
)
37 print >> sys
.stderr
, json
.dumps(warnings
, indent
=2)
38 print >> sys
.stderr
, 'there was %s warnings' % len(warnings
)
41 print >> sys
.stderr
, json
.dumps(failures
, indent
=2)
42 print >> sys
.stderr
, 'there was %s failures' % len(failures
)