diff options
author | Greg Farnum <gregory.farnum@dreamhost.com> | 2012-02-23 21:11:27 +0100 |
---|---|---|
committer | Greg Farnum <gregory.farnum@dreamhost.com> | 2012-02-23 21:12:17 +0100 |
commit | 700fe079b2cdbb444d3b623bf30636d8e5a209f3 (patch) | |
tree | cddb30eed39c1ef58a26641d59d62ad9c97ba212 /src/test/admin_socket | |
parent | osd: add "dump_ops_in_flight" to the AdminSocket. (diff) | |
download | ceph-700fe079b2cdbb444d3b623bf30636d8e5a209f3.tar.xz ceph-700fe079b2cdbb444d3b623bf30636d8e5a209f3.zip |
test: add basic test for the OSD's dump_ops_in_flight adminsocket command
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Diffstat (limited to 'src/test/admin_socket')
-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 00000000000..f748d9dc176 --- /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() |