From e1b5a7b38382a218882fe008676307e3c19ad3c1 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 15 Oct 2019 15:19:58 +0200 Subject: [PATCH] tests: Add test case for empty 'network' cdrom We don't allow such config in the schema but the code can handle that so add a test case supporting it. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- ...m-empty-network-invalid.x86_64-latest.args | 34 +++++++++++++++++++ .../disk-cdrom-empty-network-invalid.xml | 30 ++++++++++++++++ tests/qemuxml2argvtest.c | 1 + ...om-empty-network-invalid.x86_64-latest.xml | 34 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 5 files changed, 100 insertions(+) create mode 100644 tests/qemuxml2argvdata/disk-cdrom-empty-network-invalid.x86_64-latest.args create mode 100644 tests/qemuxml2argvdata/disk-cdrom-empty-network-invalid.xml create mode 100644 tests/qemuxml2xmloutdata/disk-cdrom-empty-network-invalid.x86_64-latest.xml diff --git a/tests/qemuxml2argvdata/disk-cdrom-empty-network-invalid.x86_64-latest.args b/tests/qemuxml2argvdata/disk-cdrom-empty-network-invalid.x86_64-latest.args new file mode 100644 index 0000000000..1e43047459 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-cdrom-empty-network-invalid.x86_64-latest.args @@ -0,0 +1,34 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +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 \ +-overcommit mem-lock=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 if=none,id=drive-ide0-1-1,readonly=on \ +-device ide-cd,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1 \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\ +resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/disk-cdrom-empty-network-invalid.xml b/tests/qemuxml2argvdata/disk-cdrom-empty-network-invalid.xml new file mode 100644 index 0000000000..f593b33c91 --- /dev/null +++ b/tests/qemuxml2argvdata/disk-cdrom-empty-network-invalid.xml @@ -0,0 +1,30 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 122e14b071..fd330df3e0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -997,6 +997,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-empty-network-invalid"); DO_TEST_CAPS_LATEST("disk-cdrom-bus-other"); DO_TEST("disk-iscsi", NONE); DO_TEST("disk-cdrom-network", QEMU_CAPS_KVM); diff --git a/tests/qemuxml2xmloutdata/disk-cdrom-empty-network-invalid.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-cdrom-empty-network-invalid.x86_64-latest.xml new file mode 100644 index 0000000000..f7772d832c --- /dev/null +++ b/tests/qemuxml2xmloutdata/disk-cdrom-empty-network-invalid.x86_64-latest.xml @@ -0,0 +1,34 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + + +
+ + +
+ + +
+ + + + + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index e7c029a74d..89c9494e6c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -326,6 +326,7 @@ mymain(void) DO_TEST("qemu-ns-no-env", NONE); DO_TEST("disk-aio", NONE); DO_TEST("disk-cdrom", NONE); + DO_TEST_CAPS_LATEST("disk-cdrom-empty-network-invalid"); DO_TEST("disk-cdrom-bus-other", NONE); DO_TEST("disk-floppy", NONE); DO_TEST("disk-usb-device", NONE);