From nobody Mon Dec 15 23:14:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063427079401.0863099163621; Wed, 26 Jul 2017 03:03:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2516B883CD; Wed, 26 Jul 2017 10:03:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EEE8C6A745; Wed, 26 Jul 2017 10:03:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9390C26B; Wed, 26 Jul 2017 10:03:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1MMk008977 for ; Wed, 26 Jul 2017 06:01:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id BC2F851C89; Wed, 26 Jul 2017 10:01:22 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AF166FB61; Wed, 26 Jul 2017 10:01:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2516B883CD Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:54 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 24/24] tests: qemumonitorjson: Test extraction of iSCSI device node names X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 26 Jul 2017 10:03:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- .../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-iscs= i-blockstats.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscs= i-named-nodes.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-iscs= i.result diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-block= stats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-block= stats.json new file mode 100644 index 000000000..b13386ecb --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi-blockstats.j= son @@ -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-name= d-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\", \"por= tal\": \"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\", \"d= river\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.e= xample: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\", \"por= tal\": \"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\", \"d= river\": \"iscsi\", \"transport\": \"tcp\", \"target\": \"iqn.2016-09.com.e= xample:server\"}", + "encryption_key_missing": false + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-iscsi.resul= t 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 --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list