[libvirt] [PATCH 24/24] tests: qemumonitorjson: Test extraction of iSCSI device node names

Peter Krempa posted 24 patches 8 years, 4 months ago
[libvirt] [PATCH 24/24] tests: qemumonitorjson: Test extraction of iSCSI device node names
Posted by Peter Krempa 8 years, 4 months ago
---
 .../qemumonitorjson-nodename-iscsi-blockstats.json | 113 ++++++++++++++++++++
 ...qemumonitorjson-nodename-iscsi-named-nodes.json | 114 +++++++++++++++++++++
 .../qemumonitorjson-nodename-iscsi.result          |  13 +++
 tests/qemumonitorjsontest.c                        |   1 +
 4 files changed, 241 insertions(+)
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named-nodes.json
 create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result

diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json
new file mode 100644
index 000000000..b13386ecb
--- /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 000000000..6a04e62c0
--- /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 000000000..3ffe55340
--- /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 f4169e550..150a1d879 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -2937,6 +2937,7 @@ mymain(void)
     DO_TEST_BLOCK_NODE_DETECT("old");
     DO_TEST_BLOCK_NODE_DETECT("empty");
     DO_TEST_BLOCK_NODE_DETECT("luks");
+    DO_TEST_BLOCK_NODE_DETECT("iscsi");

 #undef DO_TEST_BLOCK_NODE_DETECT

-- 
2.13.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 24/24] tests: qemumonitorjson: Test extraction of iSCSI device node names
Posted by Eric Blake 8 years, 4 months ago
On 07/26/2017 05:00 AM, Peter Krempa wrote:
> ---
>  .../qemumonitorjson-nodename-iscsi-blockstats.json | 113 ++++++++++++++++++++
>  ...qemumonitorjson-nodename-iscsi-named-nodes.json | 114 +++++++++++++++++++++
>  .../qemumonitorjson-nodename-iscsi.result          |  13 +++
>  tests/qemumonitorjsontest.c                        |   1 +
>  4 files changed, 241 insertions(+)
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named-nodes.json
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result
> 

> +++ 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\"}}",

Another fun name.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 24/24] tests: qemumonitorjson: Test extraction of iSCSI device node names
Posted by Bjoern Walk 8 years, 4 months ago
So, this test fails on S390 because the actual test in
testBlockNodeNameDetect is dependent on the ordering of the entries in
the hash table, which is different on big endian machines.

There are two other tests which have multiple results in the backing
chain, 'same-backing' and 'relative', but their keys are reasonable
similar that we got lucky and the hashes are ordered the same.

I don't suspect that code that uses the tested function,
qemuBlockNodeNameGetBackingChain, is dependent on the ordering of keys
so this is actually only a problem in the test suite.

Sorry for the late notice for this.

Bjoern
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 24/24] tests: qemumonitorjson: Test extraction of iSCSI device node names
Posted by Peter Krempa 8 years, 4 months ago
On Wed, Aug 02, 2017 at 13:50:49 +0200, Bjoern Walk wrote:
> So, this test fails on S390 because the actual test in
> testBlockNodeNameDetect is dependent on the ordering of the entries in
> the hash table, which is different on big endian machines.
> 
> There are two other tests which have multiple results in the backing
> chain, 'same-backing' and 'relative', but their keys are reasonable
> similar that we got lucky and the hashes are ordered the same.
> 
> I don't suspect that code that uses the tested function,
> qemuBlockNodeNameGetBackingChain, is dependent on the ordering of keys
> so this is actually only a problem in the test suite.

Yes, the hash function is non-deterministic. I'm working on mocking it
so that it uses a simpler algorithm which will be endian independent.

> 
> Sorry for the late notice for this.

Well, since the issue is not in this series, but the other tests needing
specific ordering were lucky enough to be ordered the same way, it was
rather hard to catch.

> 
> Bjoern



> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 24/24] tests: qemumonitorjson: Test extraction of iSCSI device node names
Posted by Jim Fehlig 8 years, 4 months ago
On 07/26/2017 04:00 AM, Peter Krempa wrote:
> ---
>   .../qemumonitorjson-nodename-iscsi-blockstats.json | 113 ++++++++++++++++++++
>   ...qemumonitorjson-nodename-iscsi-named-nodes.json | 114 +++++++++++++++++++++
>   .../qemumonitorjson-nodename-iscsi.result          |  13 +++
>   tests/qemumonitorjsontest.c                        |   1 +
>   4 files changed, 241 insertions(+)
>   create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json
>   create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-named-nodes.json
>   create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result

FYI, I've noticed that this patch causes build failures of 3.6.0 on s390x and ppc64

[  189s] 100) node-name-detect(iscsi)  ...
[  189s] In 
'/home/abuild/rpmbuild/BUILD/libvirt-3.6.0/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result':
[  189s] Offset 6
[  189s] Expect [scsi0-0-1
[  189s] filename    : 'json:{"lun": "0", "portal": "example.com:3260", 
"driver": "iscsi", "transport": "tcp", "target": "iqn.2016-09.com.example:server"}'
[  189s] format node : '#block301'
[  189s] format drv  : 'raw'
[  189s] storage node: '#block250'
[  189s] storage drv : 'iscsi'
[  189s]
[  189s] drive-virtio-disk0
[  189s] filename    : 'json:{"lun": "0", "portal": "example.com:3260", 
"driver": "iscsi", "transport": "tcp", "target": "iqn.2016-09.com.example:server"}'
[  189s] format node : '#block169'
[  189s] format drv  : 'raw'
[  189s] storage node: '#block038]
[  189s] Actual [virtio-disk0
[  189s] filename    : 'json:{"lun": "0", "portal": "example.com:3260", 
"driver": "iscsi", "transport": "tcp", "target": "iqn.2016-09.com.example:server"}'
[  189s] format node : '#block169'
[  189s] format drv  : 'raw'
[  189s] storage node: '#block038'
[  189s] storage drv : 'iscsi'
[  189s]
[  189s] drive-scsi0-0-1
[  189s] filename    : 'json:{"lun": "0", "portal": "example.com:3260", 
"driver": "iscsi", "transport": "tcp", "target": "iqn.2016-09.com.example:server"}'
[  189s] format node : '#block301'
[  189s] format drv  : 'raw'
[  189s] storage node: '#block250]
[  189s]   ... FAILED

As you can see the device order is swapped in the "Actual" output. It is odd 
that I don't see the failure on other arches. I have little experience with the 
monitor test code. Any ideas on what might cause that?

Regards,
Jim

> 
> diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.json
> new file mode 100644
> index 000000000..b13386ecb
> --- /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 000000000..6a04e62c0
> --- /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 000000000..3ffe55340
> --- /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 f4169e550..150a1d879 100644
> --- a/tests/qemumonitorjsontest.c
> +++ b/tests/qemumonitorjsontest.c
> @@ -2937,6 +2937,7 @@ mymain(void)
>       DO_TEST_BLOCK_NODE_DETECT("old");
>       DO_TEST_BLOCK_NODE_DETECT("empty");
>       DO_TEST_BLOCK_NODE_DETECT("luks");
> +    DO_TEST_BLOCK_NODE_DETECT("iscsi");
> 
>   #undef DO_TEST_BLOCK_NODE_DETECT
> 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 24/24] tests: qemumonitorjson: Test extraction of iSCSI device node names
Posted by Eric Blake 8 years, 4 months ago
On 08/02/2017 05:13 PM, Jim Fehlig wrote:
> FYI, I've noticed that this patch causes build failures of 3.6.0 on
> s390x and ppc64
> 
> [  189s] 100) node-name-detect(iscsi)  ...
> [  189s] In
> '/home/abuild/rpmbuild/BUILD/libvirt-3.6.0/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.result':
> 
> [  189s] Offset 6
> [  189s] Expect [scsi0-0-1
> [  189s] filename    : 'json:{"lun": "0", "portal": "example.com:3260",
> "driver": "iscsi", "transport": "tcp", "target":
> "iqn.2016-09.com.example:server"}'

> As you can see the device order is swapped in the "Actual" output. It is
> odd that I don't see the failure on other arches. I have little
> experience with the monitor test code. Any ideas on what might cause that?

Known issue with endianness affecting the mocked hashing; patch posted here:
https://www.redhat.com/archives/libvir-list/2017-August/msg00091.html

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list