From nobody Wed May 14 13:59:11 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15241516683421015.2206963531714; Thu, 19 Apr 2018 08:27:48 -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 F3D26312C012; Thu, 19 Apr 2018 15:27:46 +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 BC9665F731; Thu, 19 Apr 2018 15:27:43 +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 2916C181BA0A; Thu, 19 Apr 2018 15:27:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3JFQDox022172 for ; Thu, 19 Apr 2018 11:26:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9913584422; Thu, 19 Apr 2018 15:26:13 +0000 (UTC) Received: from andariel.redhat.com (ovpn-204-221.brq.redhat.com [10.40.204.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E64384424; Thu, 19 Apr 2018 15:26:12 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Thu, 19 Apr 2018 17:25:24 +0200 Message-Id: <0ac7e971cfe047d2ad45ae59c061ab3bbc7ad469.1524151023.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, Peter Krempa Subject: [libvirt] [RFC PATCH 27/30] tests: qemublock: basic qcow2 tests 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.48]); Thu, 19 Apr 2018 15:27:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add tests for backing chain handling, including a very long chain which is fully specified in the XML and an unterminated chain. The top level disk image would generate the following '-drive': file-qcow2-backing-chain-encryption.xml: -drive file=3D/var/lib/libvirt/images/a,encrypt.format=3Dluks, encrypt.key-secret=3Dnode-b-f-encalias,format=3Dqcow2,if=3Dnone,id=3Ddr= ive-dummy -device virtio-blk-pci,scsi=3Doff,drive=3Ddrive-dummy,id=3Ddummy file-qcow2-backing-chain-noopts.xml: -drive file=3D/var/lib/libvirt/images/rhel7.3.1507297895,format=3Dqcow2,if= =3Dnone,id=3Ddrive-dummy -device virtio-blk-pci,scsi=3Doff,drive=3Ddrive-dummy,id=3Ddummy file-qcow2-backing-chain-unterminated.xml: -drive file=3D/var/lib/libvirt/images/rhel7.3.1507297895,format=3Dqcow2,if= =3Dnone,id=3Ddrive-dummy -device virtio-blk-pci,scsi=3Doff,drive=3Ddrive-dummy,id=3Ddummy Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 3 + .../file-qcow2-backing-chain-encryption.json | 34 ++++++ .../file-qcow2-backing-chain-encryption.xml | 25 ++++ .../xml2json/file-qcow2-backing-chain-noopts.json | 130 +++++++++++++++++= ++++ .../xml2json/file-qcow2-backing-chain-noopts.xml | 83 +++++++++++++ .../file-qcow2-backing-chain-unterminated.json | 25 ++++ .../file-qcow2-backing-chain-unterminated.xml | 18 +++ 7 files changed, 318 insertions(+) create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-cha= in-encryption.json create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-cha= in-encryption.xml create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-cha= in-noopts.json create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-cha= in-noopts.xml create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-cha= in-unterminated.json create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-cha= in-unterminated.xml diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 55d028e9fb..44d76bebbb 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -460,6 +460,9 @@ mymain(void) TEST_DISK_TO_JSON("file-raw-aio_native"); TEST_DISK_TO_JSON("file-backing_basic-aio_threads"); TEST_DISK_TO_JSON("file-raw-luks"); + TEST_DISK_TO_JSON("file-qcow2-backing-chain-noopts"); + TEST_DISK_TO_JSON("file-qcow2-backing-chain-unterminated"); + TEST_DISK_TO_JSON("file-qcow2-backing-chain-encryption"); cleanup: virHashFree(diskxmljsondata.schema); diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encr= yption.json b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-enc= ryption.json new file mode 100644 index 0000000000..94e2ecd1e2 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption.= json @@ -0,0 +1,34 @@ +{ + "node-name": "node-b-f", + "read-only": false, + "driver": "qcow2", + "encrypt": { + "format": "luks", + "key-secret": "node-b-f-encalias" + }, + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/a", + "node-name": "node-a-s", + "read-only": false, + "discard": "unmap" + }, + "backing": "node-b-f" +} +{ + "node-name": "node-b-f", + "read-only": true, + "driver": "qcow2", + "encrypt": { + "format": "aes", + "key-secret": "node-b-f-encalias" + }, + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/b", + "node-name": "node-b-s", + "read-only": true, + "discard": "unmap" + }, + "backing": null +} diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encr= yption.xml b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encr= yption.xml new file mode 100644 index 0000000000..4e49be9bef --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption.= xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noop= ts.json b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.= json new file mode 100644 index 0000000000..3e7c08f080 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.json @@ -0,0 +1,130 @@ +{ + "node-name": "#block126", + "read-only": false, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1507297895", + "node-name": "#block004", + "read-only": false, + "discard": "unmap" + }, + "backing": "#block313" +} +{ + "node-name": "#block313", + "read-only": true, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1484071872", + "node-name": "#block256", + "read-only": true, + "discard": "unmap" + }, + "backing": "#block556" +} +{ + "node-name": "#block556", + "read-only": true, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1483615252", + "node-name": "#block418", + "read-only": true, + "discard": "unmap" + }, + "backing": "#block767" +} +{ + "node-name": "#block767", + "read-only": true, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1483605924", + "node-name": "#block624", + "read-only": true, + "discard": "unmap" + }, + "backing": "#block937" +} +{ + "node-name": "#block937", + "read-only": true, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1483605920", + "node-name": "#block869", + "read-only": true, + "discard": "unmap" + }, + "backing": "#block1157" +} +{ + "node-name": "#block1157", + "read-only": true, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1483546244", + "node-name": "#block1047", + "read-only": true, + "discard": "unmap" + }, + "backing": "#block1392" +} +{ + "node-name": "#block1392", + "read-only": true, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1483545901", + "node-name": "#block1279", + "read-only": true, + "discard": "unmap" + }, + "backing": "#block1523" +} +{ + "node-name": "#block1523", + "read-only": true, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1483545313", + "node-name": "#block1444", + "read-only": true, + "discard": "unmap" + }, + "backing": "#block1742" +} +{ + "node-name": "#block1742", + "read-only": true, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1483536402", + "node-name": "#block1602", + "read-only": true, + "discard": "unmap" + }, + "backing": "#block1909" +} +{ + "node-name": "#block1909", + "read-only": true, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.qcow2", + "node-name": "#block1864", + "read-only": true, + "discard": "unmap" + }, + "backing": null +} diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noop= ts.xml b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.x= ml new file mode 100644 index 0000000000..d69d51ebfb --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unte= rminated.json b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-u= nterminated.json new file mode 100644 index 0000000000..8fcdc48bb0 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminate= d.json @@ -0,0 +1,25 @@ +{ + "node-name": "#block126", + "read-only": false, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1507297895", + "node-name": "#block004", + "read-only": false, + "discard": "unmap" + }, + "backing": "#block313" +} +{ + "node-name": "#block313", + "read-only": true, + "driver": "qcow2", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/rhel7.3.1484071872", + "node-name": "#block256", + "read-only": true, + "discard": "unmap" + } +} diff --git a/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unte= rminated.xml b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-un= terminated.xml new file mode 100644 index 0000000000..29ed9665df --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminate= d.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list