From nobody Wed May 14 10:40:49 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 1524669810953776.1503103063357; Wed, 25 Apr 2018 08:23:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5360630FA040; Wed, 25 Apr 2018 15:23:29 +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 D2FD58618C; Wed, 25 Apr 2018 15:23:28 +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 AD6164CAA6; Wed, 25 Apr 2018 15:23:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3PFGK12020629 for ; Wed, 25 Apr 2018 11:16:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9B534202698A; Wed, 25 Apr 2018 15:16:20 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA907202323B; Wed, 25 Apr 2018 15:16:19 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 25 Apr 2018 17:15:39 +0200 Message-Id: <23d8cd555e2e2857e7ae29ca971e213073fb7a0a.1524668969.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Kevin Wolf , Peter Krempa Subject: [libvirt] [PATCH 31/35] 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 25 Apr 2018 15:23:30 +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 Reviewed-by: John Ferlan --- tests/qemublocktest.c | 3 + .../file-qcow2-backing-chain-encryption.json | 34 ++++++ .../file-qcow2-backing-chain-encryption.xml | 31 +++++ .../xml2json/file-qcow2-backing-chain-noopts.json | 130 +++++++++++++++++= ++++ .../xml2json/file-qcow2-backing-chain-noopts.xml | 113 ++++++++++++++++++ .../file-qcow2-backing-chain-unterminated.json | 25 ++++ .../file-qcow2-backing-chain-unterminated.xml | 24 ++++ 7 files changed, 360 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..a1292284bf --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption.= xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..12db679f37 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..7520cfe86a --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminate= d.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list