diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json new file mode 100644 index 0000000000..b13386ecbb --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json @@ -0,0 +1,113 @@ +[ + { + "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": "#block038" + }, + "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": 995504, + "flush_operations": 0, + "wr_operations": 0, + "rd_merged": 0, + "rd_bytes": 512, + "invalid_flush_operations": 0, + "account_failed": true, + "idle_time_ns": 117550038551, + "rd_operations": 1, + "invalid_wr_operations": 0, + "invalid_rd_operations": 0 + }, + "node-name": "#block169" + }, + { + "device": "drive-scsi0-0-1", + "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": "#block250" + }, + "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 + }, + "node-name": "#block301" + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named-nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named-nodes.json new file mode 100644 index 0000000000..6a04e62c0c --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named-nodes.json @@ -0,0 +1,114 @@ +[ + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 1073741824, + "filename": "json:{\"driver\": \"raw\", \"file\": {\"lun\": \"0\", \"portal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.example:server\"}}", + "format": "raw", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block301", + "backing_file_depth": 0, + "drv": "raw", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "json:{\"driver\": \"raw\", \"file\": {\"lun\": \"0\", \"portal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.example:server\"}}", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 1073741824, + "filename": "json:{\"lun\": \"0\", \"portal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.example:server\"}", + "format": "iscsi", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block250", + "backing_file_depth": 0, + "drv": "iscsi", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "json:{\"lun\": \"0\", \"portal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.example:server\"}", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 1073741824, + "filename": "json:{\"driver\": \"raw\", \"file\": {\"lun\": \"0\", \"portal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.example:server\"}}", + "format": "raw", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block169", + "backing_file_depth": 0, + "drv": "raw", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "json:{\"driver\": \"raw\", \"file\": {\"lun\": \"0\", \"portal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.example:server\"}}", + "encryption_key_missing": false + }, + { + "iops_rd": 0, + "detect_zeroes": "off", + "image": { + "virtual-size": 1073741824, + "filename": "json:{\"lun\": \"0\", \"portal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.example:server\"}", + "format": "iscsi", + "dirty-flag": false + }, + "iops_wr": 0, + "ro": false, + "node-name": "#block038", + "backing_file_depth": 0, + "drv": "iscsi", + "iops": 0, + "bps_wr": 0, + "write_threshold": 0, + "encrypted": false, + "bps": 0, + "bps_rd": 0, + "cache": { + "no-flush": false, + "direct": false, + "writeback": true + }, + "file": "json:{\"lun\": \"0\", \"portal\": \"example.com:3260\", \"driver\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.example:server\"}", + "encryption_key_missing": false + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result new file mode 100644 index 0000000000..3ffe553404 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result @@ -0,0 +1,13 @@ +drive-scsi0-0-1 +filename : 'json:{"lun": "0", "portal": "example.com:3260", "driver": "iscsi", "transport": "tcp", "target": "iqn.2016-09.com.example:server"}' +format node : '#block301' +format drv : 'raw' +storage node: '#block250' +storage drv : 'iscsi' + +drive-virtio-disk0 +filename : 'json:{"lun": "0", "portal": "example.com:3260", "driver": "iscsi", "transport": "tcp", "target": "iqn.2016-09.com.example:server"}' +format node : '#block169' +format drv : 'raw' +storage node: '#block038' +storage drv : 'iscsi' diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 4d302f67a9..f2090a4ca5 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2932,6 +2932,7 @@ mymain(void) DO_TEST_BLOCK_NODE_DETECT("gluster"); DO_TEST_BLOCK_NODE_DETECT("blockjob"); DO_TEST_BLOCK_NODE_DETECT("luks"); + DO_TEST_BLOCK_NODE_DETECT("iscsi"); #undef DO_TEST_BLOCK_NODE_DETECT