From: Peter Krempa Date: Wed, 28 Mar 2018 08:27:14 +0000 (+0200) Subject: tests: qemublock: Add tests for basic backing chain formats X-Git-Tag: v4.4.0-rc1~266 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b54af513d62c8d9f8fc444160fd2689bdb3c5ae1;p=thirdparty%2Flibvirt.git tests: qemublock: Add tests for basic backing chain formats Formats supporting backing chain such as qed, vmdk, don't have any other parameters than the backing store and 'qcow' has only encryption params which will be tested extra. Add this test case so they are covered since any further test cases will mainly care about 'qcow2' and 'raw'. The top level disk image would generate the following '-drive' cmdline: -drive file=/var/lib/libvirt/images/a,format=qed,if=none,id=drive-dummy -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy Signed-off-by: Peter Krempa Reviewed-by: John Ferlan --- diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 7c8b48be05..a112627853 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -414,6 +414,8 @@ mymain(void) TEST_DISK_TO_JSON("file-vhd-noopts"); TEST_DISK_TO_JSON("file-vpc-noopts"); + TEST_DISK_TO_JSON("file-backing_basic-noopts"); + cleanup: virHashFree(diskxmljsondata.schema); qemuTestDriverFree(&driver); diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-noopts.json b/tests/qemublocktestdata/xml2json/file-backing_basic-noopts.json new file mode 100644 index 0000000000..3285a6ec67 --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-backing_basic-noopts.json @@ -0,0 +1,51 @@ +{ + "node-name": "node-a-f", + "read-only": false, + "driver": "qed", + "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": "qcow", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/b", + "node-name": "node-b-s", + "read-only": true, + "discard": "unmap" + }, + "backing": "node-c-f" +} +{ + "node-name": "node-c-f", + "read-only": true, + "driver": "vmdk", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/c", + "node-name": "node-c-s", + "read-only": true, + "discard": "unmap" + }, + "backing": "node-d-f" +} +{ + "node-name": "node-d-f", + "read-only": true, + "driver": "raw", + "file": { + "driver": "file", + "filename": "/var/lib/libvirt/images/d", + "node-name": "node-d-s", + "read-only": true, + "discard": "unmap" + } +} diff --git a/tests/qemublocktestdata/xml2json/file-backing_basic-noopts.xml b/tests/qemublocktestdata/xml2json/file-backing_basic-noopts.xml new file mode 100644 index 0000000000..7c48433aec --- /dev/null +++ b/tests/qemublocktestdata/xml2json/file-backing_basic-noopts.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +