diff options
Diffstat (limited to 'src/test/admin_socket/osd_requests')
-rw-r--r-- | src/test/admin_socket/osd_requests | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/admin_socket/osd_requests b/src/test/admin_socket/osd_requests new file mode 100644 index 00000000..f748d9dc --- /dev/null +++ b/src/test/admin_socket/osd_requests @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +import json +import sys + +def main(): + """ + Read json output of admin socket command 'dump_ops_in_flight' from + stdin, and check that it is consistent. + """ + read = sys.stdin.read() + records = json.loads(read) + + info_types = ['num_ops', 'ops'] + assert sorted(records.keys()) == sorted(info_types) + assert(records['num_ops'] == len(records['ops'])) + + for op in records['ops']: + assert op['description'] is not None + assert op['received_at'] is not None + assert op['age'] is not None + assert op['flag_point'] is not None + if op['client_info']: + assert op['client_info']['client'] is not None + assert op['client_info']['tid'] is not None + +if __name__ == '__main__': + main() |