[PATCH 38/51] qemuxml2argvtest: Modernize test cases using 'host-model' CPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Modernize test cases using 'host-mode' cpu type, where the actual CPU
doesn't isn't important.

As using the host cpu from the 'latest' capabilities data would cause
test churn in case the host cpu changes in the future, convert them
using the overriden Haswell cpu.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 ...e3.args => cpu-cache-disable3.x86_64-latest.args} |  2 +-
 ... => cpu-check-default-partial.x86_64-latest.args} |  2 +-
 ...args => cpu-host-model-vendor.x86_64-latest.args} |  2 +-
 ...rgs => cpu-phys-bits-emulate2.x86_64-latest.args} |  2 +-
 tests/qemuxml2argvtest.c                             | 12 ++++++++----
 5 files changed, 12 insertions(+), 8 deletions(-)
 rename tests/qemuxml2argvdata/{cpu-cache-disable3.args => cpu-cache-disable3.x86_64-latest.args} (86%)
 rename tests/qemuxml2argvdata/{cpu-check-default-partial.args => cpu-check-default-partial.x86_64-latest.args} (87%)
 rename tests/qemuxml2argvdata/{cpu-host-model-vendor.args => cpu-host-model-vendor.x86_64-latest.args} (86%)
 rename tests/qemuxml2argvdata/{cpu-phys-bits-emulate2.args => cpu-phys-bits-emulate2.x86_64-latest.args} (86%)

diff --git a/tests/qemuxml2argvdata/cpu-cache-disable3.args b/tests/qemuxml2argvdata/cpu-cache-disable3.x86_64-latest.args
similarity index 86%
rename from tests/qemuxml2argvdata/cpu-cache-disable3.args
rename to tests/qemuxml2argvdata/cpu-cache-disable3.x86_64-latest.args
index 70fbf70e57..4adf20b55a 100644
--- a/tests/qemuxml2argvdata/cpu-cache-disable3.args
+++ b/tests/qemuxml2argvdata/cpu-cache-disable3.x86_64-latest.args
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-foo/.config \
 -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-foo/master-key.aes"}' \
 -machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
 -accel kvm \
--cpu core2duo,ds=on,acpi=on,ss=on,ht=on,tm=on,pbe=on,ds-cpl=on,vmx=on,est=on,tm2=on,cx16=on,xtpr=on,lahf-lm=on,l3-cache=off \
+-cpu Haswell,vme=on,ds=on,acpi=on,ss=on,ht=on,tm=on,pbe=on,dtes64=on,monitor=on,ds-cpl=on,vmx=on,smx=on,est=on,tm2=on,xtpr=on,pdcm=on,f16c=on,rdrand=on,pdpe1gb=on,abm=on,lahf-lm=on,l3-cache=off \
 -m size=219136k \
 -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
diff --git a/tests/qemuxml2argvdata/cpu-check-default-partial.args b/tests/qemuxml2argvdata/cpu-check-default-partial.x86_64-latest.args
similarity index 87%
rename from tests/qemuxml2argvdata/cpu-check-default-partial.args
rename to tests/qemuxml2argvdata/cpu-check-default-partial.x86_64-latest.args
index e6454e5870..a92da44bd8 100644
--- a/tests/qemuxml2argvdata/cpu-check-default-partial.args
+++ b/tests/qemuxml2argvdata/cpu-check-default-partial.x86_64-latest.args
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
 -machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
 -accel kvm \
--cpu core2duo,ds=on,acpi=on,ss=on,ht=on,tm=on,pbe=on,ds-cpl=on,vmx=on,est=on,tm2=on,cx16=on,xtpr=on,lahf-lm=on \
+-cpu Haswell,vme=on,ds=on,acpi=on,ss=on,ht=on,tm=on,pbe=on,dtes64=on,monitor=on,ds-cpl=on,vmx=on,smx=on,est=on,tm2=on,xtpr=on,pdcm=on,f16c=on,rdrand=on,pdpe1gb=on,abm=on,lahf-lm=on \
 -m size=219136k \
 -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
diff --git a/tests/qemuxml2argvdata/cpu-host-model-vendor.args b/tests/qemuxml2argvdata/cpu-host-model-vendor.x86_64-latest.args
similarity index 86%
rename from tests/qemuxml2argvdata/cpu-host-model-vendor.args
rename to tests/qemuxml2argvdata/cpu-host-model-vendor.x86_64-latest.args
index 72c108ab88..c258a1ab36 100644
--- a/tests/qemuxml2argvdata/cpu-host-model-vendor.args
+++ b/tests/qemuxml2argvdata/cpu-host-model-vendor.x86_64-latest.args
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
 -machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
 -accel tcg \
--cpu 'core2duo,vendor=Libvirt QEMU,ds=on,acpi=on,ss=on,ht=on,tm=on,pbe=on,ds-cpl=on,vmx=on,est=on,tm2=on,cx16=on,xtpr=on,lahf-lm=on' \
+-cpu 'Haswell,vendor=Libvirt QEMU,vme=on,ds=on,acpi=on,ss=on,ht=on,tm=on,pbe=on,dtes64=on,monitor=on,ds-cpl=on,vmx=on,smx=on,est=on,tm2=on,xtpr=on,pdcm=on,f16c=on,rdrand=on,pdpe1gb=on,abm=on,lahf-lm=on' \
 -m size=219136k \
 -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
diff --git a/tests/qemuxml2argvdata/cpu-phys-bits-emulate2.args b/tests/qemuxml2argvdata/cpu-phys-bits-emulate2.x86_64-latest.args
similarity index 86%
rename from tests/qemuxml2argvdata/cpu-phys-bits-emulate2.args
rename to tests/qemuxml2argvdata/cpu-phys-bits-emulate2.x86_64-latest.args
index 11c60a4d8a..92c719b553 100644
--- a/tests/qemuxml2argvdata/cpu-phys-bits-emulate2.args
+++ b/tests/qemuxml2argvdata/cpu-phys-bits-emulate2.x86_64-latest.args
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-foo/.config \
 -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-foo/master-key.aes"}' \
 -machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
 -accel kvm \
--cpu core2duo,ds=on,acpi=on,ss=on,ht=on,tm=on,pbe=on,ds-cpl=on,vmx=on,est=on,tm2=on,cx16=on,xtpr=on,lahf-lm=on,phys-bits=42 \
+-cpu Haswell,vme=on,ds=on,acpi=on,ss=on,ht=on,tm=on,pbe=on,dtes64=on,monitor=on,ds-cpl=on,vmx=on,smx=on,est=on,tm2=on,xtpr=on,pdcm=on,f16c=on,rdrand=on,pdpe1gb=on,abm=on,lahf-lm=on,phys-bits=42 \
 -m size=219136k \
 -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index d218b17d57..050d38c3fc 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1797,7 +1797,8 @@ mymain(void)
     DO_TEST_CAPS_LATEST("cpu-host-model-fallback");
     DO_TEST_CAPS_LATEST("cpu-host-model-nofallback");

-    DO_TEST_NOCAPS("cpu-host-model-vendor");
+    /* this test case uses 'cpu="host-model"', run it with Haswell host cpu to prevent test case churn */
+    DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-host-model-vendor", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL);
     DO_TEST("cpu-host-passthrough", QEMU_CAPS_KVM);
     DO_TEST_FAILURE("cpu-qemu-host-passthrough", QEMU_CAPS_KVM);

@@ -2471,11 +2472,13 @@ mymain(void)
     DO_TEST("cpu-check-full", QEMU_CAPS_KVM);
     DO_TEST("cpu-check-default-none", QEMU_CAPS_KVM);
     DO_TEST_NOCAPS("cpu-check-default-none2");
-    DO_TEST("cpu-check-default-partial", QEMU_CAPS_KVM);
+    /* this test case uses 'cpu="host-model"', run it with Haswell host cpu to prevent test case churn */
+    DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-check-default-partial", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL);
     DO_TEST("cpu-check-default-partial2", QEMU_CAPS_KVM);

     DO_TEST("cpu-cache-disable", QEMU_CAPS_KVM);
-    DO_TEST("cpu-cache-disable3", QEMU_CAPS_KVM);
+    /* this test case uses 'cpu="host-model"', run it with Haswell host cpu to prevent test case churn */
+    DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-cache-disable3", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL);
     DO_TEST("cpu-cache-passthrough", QEMU_CAPS_KVM);
     DO_TEST("cpu-cache-emulate-l3", QEMU_CAPS_KVM);
     DO_TEST_PARSE_ERROR("cpu-cache-emulate-l2", QEMU_CAPS_KVM);
@@ -2576,7 +2579,8 @@ mymain(void)

     DO_TEST("cpu-phys-bits-passthrough", QEMU_CAPS_KVM);
     DO_TEST("cpu-phys-bits-emulate", QEMU_CAPS_KVM);
-    DO_TEST("cpu-phys-bits-emulate2", QEMU_CAPS_KVM);
+    /* this test case uses 'cpu="host"', run it with Haswell host cpu to prevent test case churn */
+    DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-phys-bits-emulate2", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL);
     DO_TEST_PARSE_ERROR("cpu-phys-bits-passthrough2", QEMU_CAPS_KVM);
     DO_TEST_CAPS_LATEST("cpu-phys-bits-limit");
     DO_TEST_CAPS_LATEST("cpu-phys-bits-emulate-bare");
-- 
2.41.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux