qemuxml2argvtest: Use real capabilities in tests for picking the aarch64 GIC version

Convert 'aarch64-gic-default' and 'aarch64-gic-none' cases to use real
capabilities both latest and locked to 4.2.0 to show what would happen
with a real qemu.

Note that the qemuTestSetHostArch() calls are needed as real caps
override the setting once used. Once we convert all tests to real data
this can be dropped.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-03-24 10:46:42 +01:00
parent 2b3dbf6321
commit b2ca40d2e2
5 changed files with 90 additions and 6 deletions

View File

@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
-name guest=aarch64test,debug-threads=on \
-S \
-object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes \
-machine virt,usb=off,gic-version=2,dump-guest-core=off \
-machine virt-4.2,usb=off,gic-version=3,dump-guest-core=off \
-accel kvm \
-cpu host \
-m 1024 \
@ -27,4 +27,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
-no-acpi \
-boot strict=on \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -0,0 +1,32 @@
LC_ALL=C \
PATH=/bin \
HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \
USER=test \
LOGNAME=test \
XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \
XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
/usr/bin/qemu-system-aarch64 \
-name guest=aarch64test,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \
-machine virt,usb=off,gic-version=3,dump-guest-core=off,memory-backend=mach-virt.ram \
-accel kvm \
-cpu host \
-m 1024 \
-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
-display none \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc \
-no-shutdown \
-no-acpi \
-boot strict=on \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
-name guest=aarch64test,debug-threads=on \
-S \
-object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes \
-machine virt,usb=off,gic-version=2,dump-guest-core=off \
-machine virt-4.2,usb=off,gic-version=3,dump-guest-core=off \
-accel kvm \
-cpu host \
-m 1024 \
@ -27,4 +27,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
-no-acpi \
-boot strict=on \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -0,0 +1,32 @@
LC_ALL=C \
PATH=/bin \
HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \
USER=test \
LOGNAME=test \
XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \
XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \
XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
/usr/bin/qemu-system-aarch64 \
-name guest=aarch64test,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \
-machine virt,usb=off,gic-version=3,dump-guest-core=off,memory-backend=mach-virt.ram \
-accel kvm \
-cpu host \
-m 1024 \
-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f \
-display none \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc \
-no-shutdown \
-no-acpi \
-boot strict=on \
-audiodev '{"id":"audio1","driver":"none"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on

View File

@ -2390,8 +2390,17 @@ mymain(void)
DO_TEST("aarch64-cpu-passthrough",
QEMU_CAPS_DEVICE_VIRTIO_MMIO,
QEMU_CAPS_KVM);
DO_TEST_GIC("aarch64-gic-none", GIC_NONE,
QEMU_CAPS_KVM);
DO_TEST_FULL("aarch64-gic-none", ".aarch64-4.2.0",
ARG_GIC, GIC_NONE,
ARG_CAPS_ARCH, "aarch64",
ARG_CAPS_VER, "4.2.0",
ARG_END);
DO_TEST_FULL("aarch64-gic-none", ".aarch64-latest",
ARG_GIC, GIC_NONE,
ARG_CAPS_ARCH, "aarch64",
ARG_CAPS_VER, "latest",
ARG_END);
qemuTestSetHostArch(&driver, VIR_ARCH_AARCH64);
DO_TEST_GIC("aarch64-gic-none-v2", GIC_V2,
QEMU_CAPS_KVM);
DO_TEST_GIC("aarch64-gic-none-v3", GIC_V3,
@ -2399,8 +2408,17 @@ mymain(void)
DO_TEST_GIC("aarch64-gic-none-both", GIC_BOTH,
QEMU_CAPS_KVM);
DO_TEST_FULL("aarch64-gic-none-tcg", "", ARG_GIC, GIC_BOTH, ARG_END);
DO_TEST_GIC("aarch64-gic-default", GIC_NONE,
QEMU_CAPS_KVM);
DO_TEST_FULL("aarch64-gic-default", ".aarch64-4.2.0",
ARG_GIC, GIC_NONE,
ARG_CAPS_ARCH, "aarch64",
ARG_CAPS_VER, "4.2.0",
ARG_END);
DO_TEST_FULL("aarch64-gic-default", ".aarch64-latest",
ARG_GIC, GIC_NONE,
ARG_CAPS_ARCH, "aarch64",
ARG_CAPS_VER, "latest",
ARG_END);
qemuTestSetHostArch(&driver, VIR_ARCH_AARCH64);
DO_TEST_GIC("aarch64-gic-default-v2", GIC_V2,
QEMU_CAPS_KVM);
DO_TEST_GIC("aarch64-gic-default-v3", GIC_V3,