From b60e5f91985138b0de0ecf1f9b26354f7cb92373 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 19 Jul 2018 15:21:40 +0200 Subject: [PATCH] tests: qemu: Add xml2xml and minimal version of 'disk-cache' test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tests/qemuxml2argvdata/disk-cache.args | 38 +++++++++++++++++ tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmloutdata/disk-cache.xml | 54 +++++++++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 4 files changed, 94 insertions(+) create mode 100644 tests/qemuxml2argvdata/disk-cache.args create mode 100644 tests/qemuxml2xmloutdata/disk-cache.xml diff --git a/tests/qemuxml2argvdata/disk-cache.args b/tests/qemuxml2argvdata/disk-cache.args new file mode 100644 index 0000000000..ee2f79a99f --- /dev/null +++ b/tests/qemuxml2argvdata/disk-cache.args @@ -0,0 +1,38 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-i686 \ +-name QEMUGuest1 \ +-S \ +-machine pc-i440fx-2.6,accel=tcg,usb=off,dump-guest-core=off \ +-m 214 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ +server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot c \ +-device lsi,id=scsi0,bus=pci.0,addr=0x3 \ +-usb \ +-drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,\ +cache=writeback \ +-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ +-drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-scsi0-0-0,\ +cache=none \ +-device scsi-disk,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0 \ +-drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-virtio-disk0,\ +cache=writethrough \ +-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\ +id=virtio-disk0 \ +-drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-usb-disk1,\ +cache=directsync \ +-device usb-storage,bus=usb.0,port=1,drive=drive-usb-disk1,id=usb-disk1 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6f6b5869b3..d3c2101abd 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1037,6 +1037,7 @@ mymain(void) DO_TEST("disk-cache-v2-none", NONE); DO_TEST("disk-cache-directsync", NONE); DO_TEST("disk-cache-unsafe", NONE); + DO_TEST("disk-cache", QEMU_CAPS_SCSI_LSI, QEMU_CAPS_DEVICE_USB_STORAGE); DO_TEST_CAPS_VER("disk-cache", "2.6.0"); DO_TEST_CAPS_VER("disk-cache", "2.7.0"); DO_TEST_CAPS_LATEST("disk-cache"); diff --git a/tests/qemuxml2xmloutdata/disk-cache.xml b/tests/qemuxml2xmloutdata/disk-cache.xml new file mode 100644 index 0000000000..4c2a196ac0 --- /dev/null +++ b/tests/qemuxml2xmloutdata/disk-cache.xml @@ -0,0 +1,54 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + + + + +
+ + + + + +
+ + + + + + + +
+ + +
+ + + +
+ + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 904b86571f..a3480cd5d1 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -362,6 +362,7 @@ mymain(void) DO_TEST("disk-cache-v2-none", NONE); DO_TEST("disk-cache-directsync", NONE); DO_TEST("disk-cache-unsafe", NONE); + DO_TEST("disk-cache", QEMU_CAPS_SCSI_LSI); DO_TEST("disk-network-nbd", NONE); DO_TEST("disk-network-nbd-export", NONE); DO_TEST("disk-network-nbd-ipv6", NONE); -- GitLab