mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: qemublock: Add tests for all other format without special options
Similarly to the 'raw' case add tests for bochs, cloop, dmg, ploop, vdi vhd, and vpc. Covering all supported non-backing formats. Note that the JSON name for 'ploop' maps to 'parallels' and 'vhd' maps to 'vhdx'. Files added here would result in the followint configs: file-bochs-noopts.xml: -drive file=/path/to/i.img,format=bochs,if=none,id=drive-dummy -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy file-cloop-noopts.xml: -drive file=/path/to/i.img,format=cloop,if=none,id=drive-dummy -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy file-dmg-noopts.xml: -drive file=/path/to/i.img,format=dmg,if=none,id=drive-dummy -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy file-ploop-noopts.xml: -drive file=/path/to/i.img,format=ploop,if=none,id=drive-dummy -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy file-vdi-noopts.xml: -drive file=/path/to/i.img,format=vdi,if=none,id=drive-dummy -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy file-vhd-noopts.xml: -drive file=/path/to/i.img,format=vhd,if=none,id=drive-dummy -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy file-vpc-noopts.xml: -drive file=/path/to/i.img,format=vpc,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:
@@ -406,6 +406,13 @@ mymain(void)
|
|||||||
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");
|
TEST_DISK_TO_JSON("file-raw-noopts");
|
||||||
|
TEST_DISK_TO_JSON("file-bochs-noopts");
|
||||||
|
TEST_DISK_TO_JSON("file-cloop-noopts");
|
||||||
|
TEST_DISK_TO_JSON("file-dmg-noopts");
|
||||||
|
TEST_DISK_TO_JSON("file-ploop-noopts");
|
||||||
|
TEST_DISK_TO_JSON("file-vdi-noopts");
|
||||||
|
TEST_DISK_TO_JSON("file-vhd-noopts");
|
||||||
|
TEST_DISK_TO_JSON("file-vpc-noopts");
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virHashFree(diskxmljsondata.schema);
|
virHashFree(diskxmljsondata.schema);
|
||||||
|
|||||||
12
tests/qemublocktestdata/xml2json/file-bochs-noopts.json
Normal file
12
tests/qemublocktestdata/xml2json/file-bochs-noopts.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"node-name": "test1",
|
||||||
|
"read-only": false,
|
||||||
|
"driver": "bochs",
|
||||||
|
"file": {
|
||||||
|
"driver": "file",
|
||||||
|
"filename": "/path/to/i.img",
|
||||||
|
"node-name": "test2",
|
||||||
|
"read-only": false,
|
||||||
|
"discard": "unmap"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
tests/qemublocktestdata/xml2json/file-bochs-noopts.xml
Normal file
12
tests/qemublocktestdata/xml2json/file-bochs-noopts.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<disk device='disk'>
|
||||||
|
<driver name='qemu' type='bochs'/>
|
||||||
|
<source file='/path/to/i.img'>
|
||||||
|
<privateData>
|
||||||
|
<nodenames>
|
||||||
|
<nodename type='storage' name='test2'/>
|
||||||
|
<nodename type='format' name='test1'/>
|
||||||
|
</nodenames>
|
||||||
|
</privateData>
|
||||||
|
</source>
|
||||||
|
<target dev='vda'/>
|
||||||
|
</disk>
|
||||||
12
tests/qemublocktestdata/xml2json/file-cloop-noopts.json
Normal file
12
tests/qemublocktestdata/xml2json/file-cloop-noopts.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"node-name": "test1",
|
||||||
|
"read-only": false,
|
||||||
|
"driver": "cloop",
|
||||||
|
"file": {
|
||||||
|
"driver": "file",
|
||||||
|
"filename": "/path/to/i.img",
|
||||||
|
"node-name": "test2",
|
||||||
|
"read-only": false,
|
||||||
|
"discard": "unmap"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
tests/qemublocktestdata/xml2json/file-cloop-noopts.xml
Normal file
12
tests/qemublocktestdata/xml2json/file-cloop-noopts.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<disk device='disk'>
|
||||||
|
<driver name='qemu' type='cloop'/>
|
||||||
|
<source file='/path/to/i.img'>
|
||||||
|
<privateData>
|
||||||
|
<nodenames>
|
||||||
|
<nodename type='storage' name='test2'/>
|
||||||
|
<nodename type='format' name='test1'/>
|
||||||
|
</nodenames>
|
||||||
|
</privateData>
|
||||||
|
</source>
|
||||||
|
<target dev='vda'/>
|
||||||
|
</disk>
|
||||||
12
tests/qemublocktestdata/xml2json/file-dmg-noopts.json
Normal file
12
tests/qemublocktestdata/xml2json/file-dmg-noopts.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"node-name": "test1",
|
||||||
|
"read-only": false,
|
||||||
|
"driver": "dmg",
|
||||||
|
"file": {
|
||||||
|
"driver": "file",
|
||||||
|
"filename": "/path/to/i.img",
|
||||||
|
"node-name": "test2",
|
||||||
|
"read-only": false,
|
||||||
|
"discard": "unmap"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
tests/qemublocktestdata/xml2json/file-dmg-noopts.xml
Normal file
12
tests/qemublocktestdata/xml2json/file-dmg-noopts.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<disk device='disk'>
|
||||||
|
<driver name='qemu' type='dmg'/>
|
||||||
|
<source file='/path/to/i.img'>
|
||||||
|
<privateData>
|
||||||
|
<nodenames>
|
||||||
|
<nodename type='storage' name='test2'/>
|
||||||
|
<nodename type='format' name='test1'/>
|
||||||
|
</nodenames>
|
||||||
|
</privateData>
|
||||||
|
</source>
|
||||||
|
<target dev='vda'/>
|
||||||
|
</disk>
|
||||||
12
tests/qemublocktestdata/xml2json/file-ploop-noopts.json
Normal file
12
tests/qemublocktestdata/xml2json/file-ploop-noopts.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"node-name": "test1",
|
||||||
|
"read-only": false,
|
||||||
|
"driver": "parallels",
|
||||||
|
"file": {
|
||||||
|
"driver": "file",
|
||||||
|
"filename": "/path/to/i.img",
|
||||||
|
"node-name": "test2",
|
||||||
|
"read-only": false,
|
||||||
|
"discard": "unmap"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
tests/qemublocktestdata/xml2json/file-ploop-noopts.xml
Normal file
12
tests/qemublocktestdata/xml2json/file-ploop-noopts.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<disk device='disk'>
|
||||||
|
<driver name='qemu' type='ploop'/>
|
||||||
|
<source file='/path/to/i.img'>
|
||||||
|
<privateData>
|
||||||
|
<nodenames>
|
||||||
|
<nodename type='storage' name='test2'/>
|
||||||
|
<nodename type='format' name='test1'/>
|
||||||
|
</nodenames>
|
||||||
|
</privateData>
|
||||||
|
</source>
|
||||||
|
<target dev='vda'/>
|
||||||
|
</disk>
|
||||||
12
tests/qemublocktestdata/xml2json/file-vdi-noopts.json
Normal file
12
tests/qemublocktestdata/xml2json/file-vdi-noopts.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"node-name": "test1",
|
||||||
|
"read-only": false,
|
||||||
|
"driver": "vdi",
|
||||||
|
"file": {
|
||||||
|
"driver": "file",
|
||||||
|
"filename": "/path/to/i.img",
|
||||||
|
"node-name": "test2",
|
||||||
|
"read-only": false,
|
||||||
|
"discard": "unmap"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
tests/qemublocktestdata/xml2json/file-vdi-noopts.xml
Normal file
12
tests/qemublocktestdata/xml2json/file-vdi-noopts.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<disk device='disk'>
|
||||||
|
<driver name='qemu' type='vdi'/>
|
||||||
|
<source file='/path/to/i.img'>
|
||||||
|
<privateData>
|
||||||
|
<nodenames>
|
||||||
|
<nodename type='storage' name='test2'/>
|
||||||
|
<nodename type='format' name='test1'/>
|
||||||
|
</nodenames>
|
||||||
|
</privateData>
|
||||||
|
</source>
|
||||||
|
<target dev='vda'/>
|
||||||
|
</disk>
|
||||||
12
tests/qemublocktestdata/xml2json/file-vhd-noopts.json
Normal file
12
tests/qemublocktestdata/xml2json/file-vhd-noopts.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"node-name": "test1",
|
||||||
|
"read-only": false,
|
||||||
|
"driver": "vhdx",
|
||||||
|
"file": {
|
||||||
|
"driver": "file",
|
||||||
|
"filename": "/path/to/i.img",
|
||||||
|
"node-name": "test2",
|
||||||
|
"read-only": false,
|
||||||
|
"discard": "unmap"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
tests/qemublocktestdata/xml2json/file-vhd-noopts.xml
Normal file
12
tests/qemublocktestdata/xml2json/file-vhd-noopts.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<disk device='disk'>
|
||||||
|
<driver name='qemu' type='vhd'/>
|
||||||
|
<source file='/path/to/i.img'>
|
||||||
|
<privateData>
|
||||||
|
<nodenames>
|
||||||
|
<nodename type='storage' name='test2'/>
|
||||||
|
<nodename type='format' name='test1'/>
|
||||||
|
</nodenames>
|
||||||
|
</privateData>
|
||||||
|
</source>
|
||||||
|
<target dev='vda'/>
|
||||||
|
</disk>
|
||||||
12
tests/qemublocktestdata/xml2json/file-vpc-noopts.json
Normal file
12
tests/qemublocktestdata/xml2json/file-vpc-noopts.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"node-name": "test1",
|
||||||
|
"read-only": false,
|
||||||
|
"driver": "vpc",
|
||||||
|
"file": {
|
||||||
|
"driver": "file",
|
||||||
|
"filename": "/path/to/i.img",
|
||||||
|
"node-name": "test2",
|
||||||
|
"read-only": false,
|
||||||
|
"discard": "unmap"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
tests/qemublocktestdata/xml2json/file-vpc-noopts.xml
Normal file
12
tests/qemublocktestdata/xml2json/file-vpc-noopts.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<disk device='disk'>
|
||||||
|
<driver name='qemu' type='vpc'/>
|
||||||
|
<source file='/path/to/i.img'>
|
||||||
|
<privateData>
|
||||||
|
<nodenames>
|
||||||
|
<nodename type='storage' name='test2'/>
|
||||||
|
<nodename type='format' name='test1'/>
|
||||||
|
</nodenames>
|
||||||
|
</privateData>
|
||||||
|
</source>
|
||||||
|
<target dev='vda'/>
|
||||||
|
</disk>
|
||||||
Reference in New Issue
Block a user