From b04a3474e4f340565b5295f56076ae3bd4fdaf35 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 26 Jul 2017 10:30:18 +0200 Subject: [PATCH] tests: qemumonitorjson: Fix 'gluster' node name detection test case Add the blockstats data and fix the expected output. Reviewed-by: Eric Blake --- ...nitorjson-nodename-gluster-blockstats.json | 111 ++++++++++++ ...itorjson-nodename-gluster-named-nodes.json | 158 +++++++++--------- .../qemumonitorjson-nodename-gluster.result | 15 +- tests/qemumonitorjsontest.c | 2 +- 4 files changed, 201 insertions(+), 85 deletions(-) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-blockstats.json diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-blockstats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-blockstats.json new file mode 100644 index 0000000000..665a6b05bf --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-blockstats.json @@ -0,0 +1,111 @@ +[ + { + "device": "drive-virtio-disk0", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block282" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": true, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "backing": { + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block477" + }, + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 0, + "wr_total_time_ns": 0, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 0, + "wr_bytes": 0, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": false, + "rd_total_time_ns": 0, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 0, + "invalid_flush_operations": 0, + "account_failed": false, + "rd_operations": 0, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block596" + }, + "node-name": "#block338" + } + ] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-nodes.json index 7ea5c5d54f..e6bd2cfa72 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-nodes.json +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster-named-nodes.json @@ -1,81 +1,4 @@ [ - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "backing-image": { - "virtual-size": 197120, - "filename": "gluster://gluster-host/vol0/img0", - "format": "raw", - "actual-size": 197120 - }, - "backing-filename-format": "raw", - "virtual-size": 197120, - "filename": "gluster://gluster-host/vol0/img1", - "cluster-size": 65536, - "format": "qcow2", - "actual-size": 197120, - "format-specific": { - "type": "qcow2", - "data": { - "compat": "1.1", - "lazy-refcounts": false, - "refcount-bits": 16, - "corrupt": false - } - }, - "full-backing-filename": "gluster://gluster-host/vol0/img0", - "backing-filename": "gluster://gluster-host/vol0/img0", - "dirty-flag": false - }, - "iops_wr": 0, - "ro": false, - "node-name": "#block1008", - "backing_file_depth": 1, - "drv": "qcow2", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "backing_file": "gluster://gluster-host/vol0/img0", - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": true, - "writeback": true - }, - "file": "gluster://gluster-host/vol0/img1", - "encryption_key_missing": false - }, - { - "iops_rd": 0, - "detect_zeroes": "off", - "image": { - "virtual-size": 197120, - "filename": "gluster://gluster-host/vol0/img1", - "format": "gluster", - "actual-size": 197120 - }, - "iops_wr": 0, - "ro": false, - "node-name": "#block981", - "backing_file_depth": 0, - "drv": "gluster", - "iops": 0, - "bps_wr": 0, - "write_threshold": 0, - "encrypted": false, - "bps": 0, - "bps_rd": 0, - "cache": { - "no-flush": false, - "direct": true, - "writeback": true - }, - "file": "gluster://gluster-host/vol0/img1", - "encryption_key_missing": false - }, { "iops_rd": 0, "detect_zeroes": "off", @@ -87,7 +10,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block349", + "node-name": "#block596", "backing_file_depth": 0, "drv": "raw", "iops": 0, @@ -115,7 +38,7 @@ }, "iops_wr": 0, "ro": true, - "node-name": "#block269", + "node-name": "#block477", "backing_file_depth": 0, "drv": "gluster", "iops": 0, @@ -131,5 +54,82 @@ }, "file": "gluster://gluster-host/vol0/img0", "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "backing-image": { + "virtual-size": 197120, + "filename": "gluster://gluster-host/vol0/img0", + "format": "raw", + "actual-size": 197120 + }, + "backing-filename-format": "raw", + "virtual-size": 197120, + "filename": "gluster://gluster-host:24007/vol0/img1", + "cluster-size": 65536, + "format": "qcow2", + "actual-size": 197120, + "format-specific": { + "type": "qcow2", + "data": { + "compat": "1.1", + "lazy-refcounts": false, + "refcount-bits": 16, + "corrupt": false + } + }, + "full-backing-filename": "gluster://gluster-host/vol0/img0", + "backing-filename": "gluster://gluster-host/vol0/img0", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block338", + "backing_file_depth": 1, + "drv": "qcow2", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "backing_file": "gluster://gluster-host/vol0/img0", + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": true, + "writeback": true + }, + "file": "gluster://gluster-host:24007/vol0/img1", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 197120, + "filename": "gluster://gluster-host:24007/vol0/img1", + "format": "gluster", + "actual-size": 197120 + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block282", + "backing_file_depth": 0, + "drv": "gluster", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": true, + "writeback": true + }, + "file": "gluster://gluster-host:24007/vol0/img1", + "encryption_key_missing": false } ] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.result b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.result index d995762023..6289fdd1ad 100644 --- a/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.result +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-gluster.result @@ -1,6 +1,11 @@ -filename : 'gluster://gluster-host/vol0/img1' -format node : '#block1008' -storage node: '#block981' +drive-virtio-disk0 +filename : 'gluster://gluster-host:24007/vol0/img1' +format node : '#block338' +format drv : 'qcow2' +storage node: '#block282' +storage drv : 'gluster' filename : 'gluster://gluster-host/vol0/img0' - format node : '#block349' - storage node: '#block269' + format node : '#block596' + format drv : 'raw' + storage node: '#block477' + storage drv : 'gluster' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 2b10a75cd6..8edb3f121e 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2929,7 +2929,7 @@ mymain(void) DO_TEST_BLOCK_NODE_DETECT("basic"); DO_TEST_BLOCK_NODE_DETECT("same-backing"); DO_TEST_BLOCK_NODE_DETECT("relative"); -/* DO_TEST_BLOCK_NODE_DETECT("gluster"); */ + DO_TEST_BLOCK_NODE_DETECT("gluster"); #undef DO_TEST_BLOCK_NODE_DETECT