From ea13c12940b7ebcffebd409293b0bfe88e315830 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 28 Jan 2019 15:59:36 +0100 Subject: [PATCH] tests: qemuxml2argv: Add CDROM disks for all untested buses Add full and empty cdroms on 'usb' and 'sd' bus to have test coverage. Note that this does not guarantee that qemu will accept them. Signed-off-by: Peter Krempa --- .../disk-cdrom-bus-other.x86_64-latest.args | 38 ++++++++++++++ .../qemuxml2argvdata/disk-cdrom-bus-other.xml | 47 +++++++++++++++++ tests/qemuxml2argvtest.c | 1 + .../disk-cdrom-bus-other.xml | 51 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 5 files changed, 138 insertions(+) create mode 100644 tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/disk-cdrom-bus-other.xml create mode 100644 tests/qemuxml2xmloutdata/disk-cdrom-bus-other.xml diff --git a/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args b/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.args new file mode 100644 index 0000000000..a64da3edd6 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-cdrom-bus-other.x86_64-latest.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 guest=QEMUGuest1,debug-threads=on \ +-S \ +-object secret,id=masterKey0,format=raw,\ +file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ +-machine pc,accel=tcg,usb=off,dump-guest-core=off \ +-m 214 \ +-realtime mlock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server,nowait \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-no-acpi \ +-boot strict=on \ +-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \ +-drive file=/root/boot.iso,format=raw,if=none,id=drive-usb-disk0,media=cdrom,\ +readonly=on \ +-device usb-storage,bus=usb.0,port=1,drive=drive-usb-disk0,id=usb-disk0,\ +removable=off \ +-drive if=none,id=drive-usb-disk1,media=cdrom,readonly=on \ +-device usb-storage,bus=usb.0,port=2,drive=drive-usb-disk1,id=usb-disk1,\ +removable=off \ +-drive file=/root/boot2.iso,format=raw,if=sd,index=2,media=cdrom,readonly=on \ +-drive if=sd,index=3,media=cdrom,readonly=on \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ +resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml b/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml new file mode 100644 index 0000000000..a142373afb --- /dev/null +++ b/tests/qemuxml2argvdata/disk-cdrom-bus-other.xml @@ -0,0 +1,47 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + This test is meant for testing CDROMS with buses which don't really support them + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b42dd0b28e..dd4f73a5fb 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1011,6 +1011,7 @@ mymain(void) DO_TEST("disk-cdrom", NONE); DO_TEST_CAPS_VER("disk-cdrom", "2.12.0"); DO_TEST_CAPS_LATEST("disk-cdrom"); + DO_TEST_CAPS_LATEST("disk-cdrom-bus-other"); DO_TEST("disk-iscsi", NONE); DO_TEST("disk-cdrom-network", QEMU_CAPS_KVM); DO_TEST_CAPS_VER("disk-cdrom-network", "2.12.0"); diff --git a/tests/qemuxml2xmloutdata/disk-cdrom-bus-other.xml b/tests/qemuxml2xmloutdata/disk-cdrom-bus-other.xml new file mode 100644 index 0000000000..e5eb7d6a98 --- /dev/null +++ b/tests/qemuxml2xmloutdata/disk-cdrom-bus-other.xml @@ -0,0 +1,51 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + This test is meant for testing CDROMS with buses which don't really support them + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 370920f926..b38cbd6994 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -346,6 +346,7 @@ mymain(void) DO_TEST("qemu-ns-no-env", NONE); DO_TEST("disk-aio", NONE); DO_TEST("disk-cdrom", NONE); + DO_TEST("disk-cdrom-bus-other", NONE); DO_TEST("disk-floppy", NONE); DO_TEST("disk-usb-device", NONE); DO_TEST("disk-virtio", NONE); -- 2.47.2