From deb38c4503597a8e0b3e74c6112ef28a15b072c8 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Thu, 9 Mar 2017 16:38:56 +0100 Subject: [PATCH] tests: Test ACPI, UEFI requirements Make sure every combination of ACPI and UEFI works, or fails to work, as expected. --- .../qemuxml2argv-aarch64-acpi-nouefi.args | 22 ++++++++++++++++++ .../qemuxml2argv-aarch64-acpi-nouefi.xml | 22 ++++++++++++++++++ .../qemuxml2argv-aarch64-acpi-uefi.args | 22 ++++++++++++++++++ .../qemuxml2argv-aarch64-acpi-uefi.xml | 21 +++++++++++++++++ .../qemuxml2argv-aarch64-noacpi-nouefi.args | 22 ++++++++++++++++++ .../qemuxml2argv-aarch64-noacpi-nouefi.xml | 19 +++++++++++++++ .../qemuxml2argv-aarch64-noacpi-uefi.args | 23 +++++++++++++++++++ .../qemuxml2argv-aarch64-noacpi-uefi.xml | 18 +++++++++++++++ .../qemuxml2argv-q35-acpi-nouefi.args | 21 +++++++++++++++++ .../qemuxml2argv-q35-acpi-nouefi.xml | 22 ++++++++++++++++++ .../qemuxml2argv-q35-acpi-uefi.args | 22 ++++++++++++++++++ .../qemuxml2argv-q35-acpi-uefi.xml | 21 +++++++++++++++++ .../qemuxml2argv-q35-noacpi-nouefi.args | 22 ++++++++++++++++++ .../qemuxml2argv-q35-noacpi-nouefi.xml | 19 +++++++++++++++ .../qemuxml2argv-q35-noacpi-uefi.xml | 18 +++++++++++++++ tests/qemuxml2argvtest.c | 14 +++++++++++ 16 files changed, 328 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-uefi.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.args new file mode 100644 index 0000000000..5d9e1fb7c8 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.args @@ -0,0 +1,22 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-aarch64 \ +-name guest \ +-S \ +-M virt \ +-cpu host \ +-m 1024 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ +-nographic \ +-nodefconfig \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ +-boot c \ +-kernel /var/lib/libvirt/images/guest.vmlinux \ +-initrd /var/lib/libvirt/images/guest.initramfs \ +-append 'console=ttyAMA0 rw root=/dev/vda rootwait' diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.xml new file mode 100644 index 0000000000..cda1b1bdc6 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-nouefi.xml @@ -0,0 +1,22 @@ + + guest + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1 + + hvm + /var/lib/libvirt/images/guest.vmlinuz + /var/lib/libvirt/images/guest.initramfs + console=ttyAMA0 rw root=/dev/vda rootwait + + + + + + cortex-a57 + + + /usr/bin/qemu-system-aarch64 + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args new file mode 100644 index 0000000000..36371ba02d --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.args @@ -0,0 +1,22 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-aarch64 \ +-name guest \ +-S \ +-M virt \ +-cpu cortex-a57 \ +-drive file=/usr/share/AAVMF/AAVMF_CODE.fd,if=pflash,format=raw,unit=0,\ +readonly=on \ +-drive file=/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=pflash,format=raw,\ +unit=1 \ +-m 1024 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ +-boot c diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.xml new file mode 100644 index 0000000000..5de2eb5d3c --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-acpi-uefi.xml @@ -0,0 +1,21 @@ + + guest + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1 + + hvm + /usr/share/AAVMF/AAVMF_CODE.fd + /var/lib/libvirt/qemu/nvram/guest_VARS.fd + + + + + + cortex-a57 + + + /usr/bin/qemu-system-aarch64 + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args new file mode 100644 index 0000000000..301eda89e2 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.args @@ -0,0 +1,22 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-aarch64 \ +-name guest \ +-S \ +-M virt \ +-cpu cortex-a57 \ +-m 1024 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-kernel /var/lib/libvirt/images/guest.vmlinuz \ +-initrd /var/lib/libvirt/images/guest.initramfs \ +-append 'console=ttyAMA0 rw root=/dev/vda rootwait' diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.xml new file mode 100644 index 0000000000..e8551ed2d9 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-nouefi.xml @@ -0,0 +1,19 @@ + + guest + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1 + + hvm + /var/lib/libvirt/images/guest.vmlinuz + /var/lib/libvirt/images/guest.initramfs + console=ttyAMA0 rw root=/dev/vda rootwait + + + cortex-a57 + + + /usr/bin/qemu-system-aarch64 + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args new file mode 100644 index 0000000000..c62de750fe --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.args @@ -0,0 +1,23 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-aarch64 \ +-name guest \ +-S \ +-M virt \ +-cpu cortex-a57 \ +-drive file=/usr/share/AAVMF/AAVMF_CODE.fd,if=pflash,format=raw,unit=0,\ +readonly=on \ +-drive file=/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=pflash,format=raw,\ +unit=1 \ +-m 1024 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ +-no-acpi \ +-boot c diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.xml new file mode 100644 index 0000000000..e66b805da4 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-noacpi-uefi.xml @@ -0,0 +1,18 @@ + + guest + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1 + + hvm + /usr/share/AAVMF/AAVMF_CODE.fd + /var/lib/libvirt/qemu/nvram/guest_VARS.fd + + + cortex-a57 + + + /usr/bin/qemu-system-aarch64 + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args new file mode 100644 index 0000000000..eea422dd45 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.args @@ -0,0 +1,21 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-x86_64 \ +-name guest \ +-S \ +-M q35 \ +-cpu Haswell \ +-m 1024 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ +-boot c \ +-kernel /var/lib/libvirt/images/guest.vmlinuz \ +-initrd /var/lib/libvirt/images/guest.initramfs \ +-append 'rw root=/dev/vda rootwait' diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.xml new file mode 100644 index 0000000000..7d735f99c4 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-nouefi.xml @@ -0,0 +1,22 @@ + + guest + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1 + + hvm + /var/lib/libvirt/images/guest.vmlinuz + /var/lib/libvirt/images/guest.initramfs + rw root=/dev/vda rootwait + + + + + + Haswell + + + /usr/bin/qemu-system-x86_64 + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args new file mode 100644 index 0000000000..9dfa583d2b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.args @@ -0,0 +1,22 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-x86_64 \ +-name guest \ +-S \ +-M q35 \ +-cpu Haswell \ +-drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,\ +readonly=on \ +-drive file=/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=pflash,format=raw,\ +unit=1 \ +-m 1024 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ +-boot c diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.xml new file mode 100644 index 0000000000..4eb5a466e9 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-acpi-uefi.xml @@ -0,0 +1,21 @@ + + guest + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1 + + hvm + /usr/share/OVMF/OVMF_CODE.fd + /var/lib/libvirt/qemu/nvram/guest_VARS.fd + + + + + + Haswell + + + /usr/bin/qemu-system-x86_64 + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args new file mode 100644 index 0000000000..ba0f59cddb --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.args @@ -0,0 +1,22 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-system-x86_64 \ +-name guest \ +-S \ +-M q35 \ +-cpu Haswell \ +-m 1024 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/lib/domain--1-guest/monitor.sock,server,nowait \ +-no-acpi \ +-boot c \ +-kernel /var/lib/libvirt/images/guest.vmlinuz \ +-initrd /var/lib/libvirt/images/guest.initramfs \ +-append 'rw root=/dev/vda rootwait' diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.xml new file mode 100644 index 0000000000..163b424eac --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-nouefi.xml @@ -0,0 +1,19 @@ + + guest + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1 + + hvm + /var/lib/libvirt/images/guest.vmlinuz + /var/lib/libvirt/images/guest.initramfs + rw root=/dev/vda rootwait + + + Haswell + + + /usr/bin/qemu-system-x86_64 + + + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-uefi.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-uefi.xml new file mode 100644 index 0000000000..91c83c808c --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35-noacpi-uefi.xml @@ -0,0 +1,18 @@ + + guest + 496d7ea8-9739-544b-4ebd-ef08be936e8b + 1048576 + 1 + + hvm + /usr/share/OVMF/OVMF_CODE.fd + /var/lib/libvirt/qemu/nvram/guest_VARS.fd + + + Haswell + + + /usr/bin/qemu-system-x86_64 + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5c0e1e8abd..cfd6dcd55e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -757,6 +757,13 @@ mymain(void) QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_SMM_OPT, QEMU_CAPS_VIRTIO_SCSI); + + /* Make sure all combinations of ACPI and UEFI behave as expected */ + DO_TEST("q35-acpi-uefi", NONE); + DO_TEST_PARSE_ERROR("q35-noacpi-uefi", NONE); + DO_TEST("q35-noacpi-nouefi", NONE); + DO_TEST("q35-acpi-nouefi", NONE); + DO_TEST("clock-utc", QEMU_CAPS_NODEFCONFIG); DO_TEST("clock-localtime", NONE); DO_TEST("clock-localtime-basis-localtime", QEMU_CAPS_RTC); @@ -2316,6 +2323,13 @@ mymain(void) DO_TEST_FAILURE("aarch64-kvm-32-on-64", QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DEVICE_VIRTIO_MMIO, QEMU_CAPS_KVM); + + /* Make sure all combinations of ACPI and UEFI behave as expected */ + DO_TEST("aarch64-acpi-uefi", NONE); + DO_TEST("aarch64-noacpi-uefi", NONE); + DO_TEST("aarch64-noacpi-nouefi", NONE); + DO_TEST_PARSE_ERROR("aarch64-acpi-nouefi", NONE); + qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE); DO_TEST("kvm-pit-delay", QEMU_CAPS_KVM_PIT_TICK_POLICY);