Integrate the two special cases used for schema testing into the more
useful qemuxml2argvtest, whose input data is still tested against the
schema.
Add also a xml output variant.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tests/domainschemadata/default-cache-mode.xml | 26 ------------
.../domain-disk-source-space.xml | 36 -----------------
.../disk-sata-device.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/disk-sata-device.xml | 3 +-
.../disk-sata-device.x86_64-latest.xml | 40 +++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
6 files changed, 44 insertions(+), 64 deletions(-)
delete mode 100644 tests/domainschemadata/default-cache-mode.xml
delete mode 100644 tests/domainschemadata/domain-disk-source-space.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-sata-device.x86_64-latest.xml
diff --git a/tests/domainschemadata/default-cache-mode.xml
b/tests/domainschemadata/default-cache-mode.xml
deleted file mode 100644
index a11232316d..0000000000
--- a/tests/domainschemadata/default-cache-mode.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<domain type='qemu'>
- <name>QEMUGuest1</name>
- <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
- <memory unit='KiB'>219200</memory>
- <currentMemory unit='KiB'>219200</currentMemory>
- <vcpu>1</vcpu>
- <os>
- <type arch='i686' machine='pc'>hvm</type>
- <boot dev='hd'/>
- </os>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>destroy</on_crash>
- <devices>
- <emulator>/usr/bin/qemu-system-i386</emulator>
- <disk type='file' device='disk'>
- <driver name='qemu' type='raw' cache='default'/>
- <source file='/var/lib/libvirt/images/QEMUGuest1'/>
- <target dev='hda' bus='ide'/>
- <address type='drive' controller='0' bus='0'
unit='0'/>
- </disk>
- <controller type='ide' index='0'/>
- <memballoon model='virtio'/>
- </devices>
-</domain>
diff --git a/tests/domainschemadata/domain-disk-source-space.xml
b/tests/domainschemadata/domain-disk-source-space.xml
deleted file mode 100644
index 553b6c7f01..0000000000
--- a/tests/domainschemadata/domain-disk-source-space.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<domain type='kvm'>
- <name>dummy</name>
- <uuid>aa86471a-e67b-41b1-8d7d-2dc37c2ac5ec</uuid>
- <memory unit='KiB'>2097152</memory>
- <currentMemory unit='KiB'>2097152</currentMemory>
- <vcpu placement='static'>4</vcpu>
- <os>
- <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
- </os>
- <features>
- <acpi/>
- <apic/>
- </features>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>restart</on_crash>
- <pm>
- <suspend-to-mem enabled='no'/>
- <suspend-to-disk enabled='no'/>
- </pm>
- <devices>
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
- <disk type='file' device='cdrom'>
- <driver name='qemu' type='raw'/>
- <source file='/a/path/with some space in it.iso'/>
- <target dev='hda' bus='ide'/>
- <readonly/>
- <boot order='1'/>
- <address type='drive' controller='0' bus='0'
target='0' unit='0'/>
- </disk>
- <controller type='pci' index='0' model='pci-root'/>
- <controller type='ide' index='0'>
- <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
- </controller>
- </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/disk-sata-device.x86_64-latest.args
b/tests/qemuxml2argvdata/disk-sata-device.x86_64-latest.args
index 9365104c20..3cf305f14c 100644
--- a/tests/qemuxml2argvdata/disk-sata-device.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-sata-device.x86_64-latest.args
@@ -29,7 +29,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-boot strict=on \
-device
'{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}'
\
-device
'{"driver":"ahci","id":"sata0","bus":"pci.0","addr":"0x2"}'
\
--blockdev
'{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"driver":"host_device","filename":"/dev/HostVG/QEMUG
uest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
-blockdev
'{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}'
\
-device
'{"driver":"ide-hd","bus":"sata0.0","drive":"libvirt-1-format","id":"sata0-0-0","bootindex":1}'
\
-audiodev
'{"id":"audio1","driver":"none"}' \
diff --git a/tests/qemuxml2argvdata/disk-sata-device.xml
b/tests/qemuxml2argvdata/disk-sata-device.xml
index 5dbf08ef1d..a9def2923e 100644
--- a/tests/qemuxml2argvdata/disk-sata-device.xml
+++ b/tests/qemuxml2argvdata/disk-sata-device.xml
@@ -15,7 +15,8 @@
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='block' device='disk'>
- <source dev='/dev/HostVG/QEMUGuest1'/>
+ <driver cache='default'/>
+ <source dev='/dev/HostVG/QEMUG uest1'/>
<target dev='sda' bus='sata'/>
<address type='drive' controller='0' bus='0'
target='0' unit='0'/>
</disk>
diff --git a/tests/qemuxml2xmloutdata/disk-sata-device.x86_64-latest.xml
b/tests/qemuxml2xmloutdata/disk-sata-device.x86_64-latest.xml
new file mode 100644
index 0000000000..cd20f5185b
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/disk-sata-device.x86_64-latest.xml
@@ -0,0 +1,40 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu64</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUG uest1'/>
+ <target dev='sda' bus='sata'/>
+ <address type='drive' controller='0' bus='0'
target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0' model='piix3-uhci'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x03' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 2d2d800523..9c7d6c6b2b 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -348,6 +348,7 @@ mymain(void)
DO_TEST_NOCAPS("disk-network-tlsx509-vxhs");
DO_TEST_CAPS_LATEST("disk-nvme");
DO_TEST_CAPS_LATEST("disk-vhostuser");
+ DO_TEST_CAPS_LATEST("disk-sata-device");
DO_TEST_CAPS_LATEST("disk-scsi");
DO_TEST("disk-virtio-scsi-reservations",
QEMU_CAPS_VIRTIO_SCSI,
--
2.39.2