]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2argvtest: Modernize s390 cpu tests
authorPeter Krempa <pkrempa@redhat.com>
Fri, 24 Mar 2023 13:53:01 +0000 (14:53 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 3 Apr 2023 07:19:07 +0000 (09:19 +0200)
Use real capabilities for the CPU test. The negative test case for QEMUs
without QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION is removed as the feature is
now supported by all supported qemu versions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvdata/cpu-s390-features.err [deleted file]
tests/qemuxml2argvdata/cpu-s390-features.s390x-latest.args [moved from tests/qemuxml2argvdata/cpu-s390-features.args with 68% similarity]
tests/qemuxml2argvdata/cpu-s390-zEC12.s390x-latest.args [moved from tests/qemuxml2argvdata/cpu-s390-zEC12.args with 67% similarity]
tests/qemuxml2argvtest.c

diff --git a/tests/qemuxml2argvdata/cpu-s390-features.err b/tests/qemuxml2argvdata/cpu-s390-features.err
deleted file mode 100644 (file)
index 5f078fc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-internal error: CPU features not supported by hypervisor for s390x architecture
similarity index 68%
rename from tests/qemuxml2argvdata/cpu-s390-features.args
rename to tests/qemuxml2argvdata/cpu-s390-features.s390x-latest.args
index 69e705e8952bc262efa051e8adaadfc34332dbd2..d6c1d6e2785000427d4b870124fdaea86e469f76 100644 (file)
@@ -9,11 +9,12 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest1/.config \
 /usr/bin/qemu-system-s390x \
 -name guest=guest1,debug-threads=on \
 -S \
--object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-guest1/master-key.aes \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest1/master-key.aes"}' \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
 -accel kvm \
 -cpu zEC12,dfppc=on,stckf=off \
 -m 214 \
+-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \
 -overcommit mem-lock=off \
 -smp 1,sockets=1,cores=1,threads=1 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
@@ -26,4 +27,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest1/.config \
 -no-shutdown \
 -boot strict=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
similarity index 67%
rename from tests/qemuxml2argvdata/cpu-s390-zEC12.args
rename to tests/qemuxml2argvdata/cpu-s390-zEC12.s390x-latest.args
index 1a33d6bccac0d1609e01f06f8e206e6f0ae7ec92..8ad4fd90ce81ca0dcfec285fad5b904e6d5a785f 100644 (file)
@@ -9,11 +9,12 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest1/.config \
 /usr/bin/qemu-system-s390x \
 -name guest=guest1,debug-threads=on \
 -S \
--object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain--1-guest1/master-key.aes \
--machine s390-ccw-virtio,usb=off,dump-guest-core=off \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest1/master-key.aes"}' \
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
 -accel kvm \
 -cpu zEC12 \
 -m 214 \
+-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \
 -overcommit mem-lock=off \
 -smp 1,sockets=1,cores=1,threads=1 \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
@@ -26,4 +27,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest1/.config \
 -no-shutdown \
 -boot strict=on \
 -audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index 9fcd0314b6c313b471c0a8458a51bd46d99a5c24..68772d12abe28c7c19b8ebdcce11616f4be1364a 100644 (file)
@@ -1871,11 +1871,8 @@ mymain(void)
     DO_TEST("cpu-host-passthrough", QEMU_CAPS_KVM);
     DO_TEST_FAILURE("cpu-qemu-host-passthrough", QEMU_CAPS_KVM);
 
-    qemuTestSetHostArch(&driver, VIR_ARCH_S390X);
-    DO_TEST("cpu-s390-zEC12", QEMU_CAPS_KVM);
-    DO_TEST("cpu-s390-features", QEMU_CAPS_KVM, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION);
-    DO_TEST_FAILURE("cpu-s390-features", QEMU_CAPS_KVM);
-    qemuTestSetHostArch(&driver, VIR_ARCH_NONE);
+    DO_TEST_CAPS_ARCH_LATEST("cpu-s390-zEC12", "s390x");
+    DO_TEST_CAPS_ARCH_LATEST("cpu-s390-features", "s390x");
 
     qemuTestSetHostCPU(&driver, driver.hostarch, qemuTestGetCPUDef(QEMU_CPU_DEF_HASWELL));
     DO_TEST("cpu-Haswell", QEMU_CAPS_KVM);