From nobody Fri May 16 05:10:37 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 1501063421891777.5031145875255; Wed, 26 Jul 2017 03:03:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2240EFBB5; Wed, 26 Jul 2017 10:03:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9FE568D92; Wed, 26 Jul 2017 10:03:38 +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 37998180BA9B; Wed, 26 Jul 2017 10:03:13 +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 v6QA1JYu008960 for ; Wed, 26 Jul 2017 06:01:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 19E5B6FB61; Wed, 26 Jul 2017 10:01:19 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A9916FE60; Wed, 26 Jul 2017 10:01:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2240EFBB5 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.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:52 +0200 Message-Id: <27b36678ace48789c4818f58b64666096e928e8a.1501062802.git.pkrempa@redhat.com> 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 22/24] tests: qemumonitorjson: Old and empty test case for node name detection 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 26 Jul 2017 10:03:39 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Prior to qemu 2.5 the node names would not be generated, thus would be missing from 'query-blockstats' and 'query-named-block-nodes'. Test that the code correctly detects nothing. Additionally make sure that a VM without disks does not cause problems. The test case change is necessary as our test file checker does not play well with empty files. --- .../qemumonitorjson-nodename-empty-blockstats.json | 2 + ...qemumonitorjson-nodename-empty-named-nodes.json | 2 + .../qemumonitorjson-nodename-empty.result | 1 + .../qemumonitorjson-nodename-old-blockstats.json | 160 +++++++++++++++++= ++++ .../qemumonitorjson-nodename-old-named-nodes.json | 2 + .../qemumonitorjson-nodename-old.result | 1 + tests/qemumonitorjsontest.c | 5 + 7 files changed, 173 insertions(+) create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empt= y-blockstats.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empt= y-named-nodes.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-empt= y.result create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old-= blockstats.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old-= named-nodes.json create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-old.= result diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-block= stats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-block= stats.json new file mode 100644 index 000000000..0d4f101c7 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-blockstats.j= son @@ -0,0 +1,2 @@ +[ +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-named= -nodes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-name= d-nodes.json new file mode 100644 index 000000000..0d4f101c7 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty-named-nodes.= json @@ -0,0 +1,2 @@ +[ +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty.resul= t b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty.result new file mode 100644 index 000000000..9dafe9be2 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-empty.result @@ -0,0 +1 @@ +nothing diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-blockst= ats.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-blockstat= s.json new file mode 100644 index 000000000..26c14f9f2 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-blockstats.json @@ -0,0 +1,160 @@ +[ + { + "device": "drive-virtio-disk0", + "parent": { + "stats": { + "flush_total_time_ns": 0, + "wr_highest_offset": 32899072, + "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 + } + }, + "stats": { + "flush_total_time_ns": 452246313, + "wr_highest_offset": 8072282112, + "wr_total_time_ns": 4803102521, + "failed_wr_operations": 0, + "failed_rd_operations": 0, + "wr_merged": 8, + "wr_bytes": 6517248, + "timed_stats": [ + + ], + "failed_flush_operations": 0, + "account_invalid": true, + "rd_total_time_ns": 11065169148, + "flush_operations": 10, + "wr_operations": 129, + "rd_merged": 77, + "rd_bytes": 76399104, + "invalid_flush_operations": 0, + "account_failed": true, + "idle_time_ns": 22663656304, + "rd_operations": 4038, + "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 + } + }, + "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 + }, + "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 + } + }, + "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 + } + } + } + } +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-named-n= odes.json b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-named-no= des.json new file mode 100644 index 000000000..0d4f101c7 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old-named-nodes.js= on @@ -0,0 +1,2 @@ +[ +] diff --git a/tests/qemumonitorjsondata/qemumonitorjson-nodename-old.result = b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old.result new file mode 100644 index 000000000..9dafe9be2 --- /dev/null +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-old.result @@ -0,0 +1 @@ +nothing diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 0601c1188..06d97989e 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2763,6 +2763,9 @@ testBlockNodeNameDetect(const void *opaque) virBufferTrim(&buf, "\n", -1); + if (virBufferUse(&buf) =3D=3D 0) + virBufferAddLit(&buf, "nothing\n"); + if (virBufferCheckError(&buf) < 0) goto cleanup; @@ -2931,6 +2934,8 @@ mymain(void) DO_TEST_BLOCK_NODE_DETECT("relative"); DO_TEST_BLOCK_NODE_DETECT("gluster"); DO_TEST_BLOCK_NODE_DETECT("blockjob"); + DO_TEST_BLOCK_NODE_DETECT("old"); + DO_TEST_BLOCK_NODE_DETECT("empty"); #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