mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
tests: qemublock: Add basic 'raw' file test
Test the JSON props generator with a very simple 'raw' image with no other options. The node-names for the image are 31 bytes long so that we validate our node name detector. The top level disk image would generate the following '-drive' cmdline: -drive file=/var/lib/libvirt/images/i.img,format=raw,if=none,id=drive-dummy -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
8f60653de3
commit
5ce01b15e1
@ -405,6 +405,8 @@ mymain(void)
|
|||||||
TEST_DISK_TO_JSON_FULL("nodename-long-format", true);
|
TEST_DISK_TO_JSON_FULL("nodename-long-format", true);
|
||||||
TEST_DISK_TO_JSON_FULL("nodename-long-protocol", true);
|
TEST_DISK_TO_JSON_FULL("nodename-long-protocol", true);
|
||||||
|
|
||||||
|
TEST_DISK_TO_JSON("file-raw-noopts");
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virHashFree(diskxmljsondata.schema);
|
virHashFree(diskxmljsondata.schema);
|
||||||
qemuTestDriverFree(&driver);
|
qemuTestDriverFree(&driver);
|
||||||
|
12
tests/qemublocktestdata/xml2json/file-raw-noopts.json
Normal file
12
tests/qemublocktestdata/xml2json/file-raw-noopts.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"node-name": "0123456789ABCDEF0123456789ABCDE",
|
||||||
|
"read-only": false,
|
||||||
|
"driver": "raw",
|
||||||
|
"file": {
|
||||||
|
"driver": "file",
|
||||||
|
"filename": "/var/lib/libvirt/images/i.img",
|
||||||
|
"node-name": "0123456789ABCDEF0123456789ABCDE",
|
||||||
|
"read-only": false,
|
||||||
|
"discard": "unmap"
|
||||||
|
}
|
||||||
|
}
|
12
tests/qemublocktestdata/xml2json/file-raw-noopts.xml
Normal file
12
tests/qemublocktestdata/xml2json/file-raw-noopts.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<disk device='disk'>
|
||||||
|
<driver name='qemu' type='raw'/>
|
||||||
|
<source file='/var/lib/libvirt/images/i.img'>
|
||||||
|
<privateData>
|
||||||
|
<nodenames>
|
||||||
|
<nodename type='storage' name='0123456789ABCDEF0123456789ABCDE'/>
|
||||||
|
<nodename type='format' name='0123456789ABCDEF0123456789ABCDE'/>
|
||||||
|
</nodenames>
|
||||||
|
</privateData>
|
||||||
|
</source>
|
||||||
|
<target dev='vda'/>
|
||||||
|
</disk>
|
Loading…
x
Reference in New Issue
Block a user