From 7bdd8581758ef261858942bbeab3e44ca59f3b69 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Thu, 31 Jan 2013 10:14:18 -0200 Subject: [PATCH] qemu_cpu.cfg: remove duplication of settings The duplication of settings makes it very hard to spot mistakes. This is a new version of the config file that uses nesting and cartesian products of variants to avoid duplication. To make it easier to test wheter the changes are working, this generates exactly the same dictionaries as the original config, in exactly the same sequence, including all the bugs. Look for the #FIXME comments for places that will be cleaned up or fixed later. Signed-off-by: Eduardo Habkost --- qemu/tests/cfg/qemu_cpu.cfg | 280 +++++++++++++++++------------------- 1 file changed, 134 insertions(+), 146 deletions(-) diff --git a/qemu/tests/cfg/qemu_cpu.cfg b/qemu/tests/cfg/qemu_cpu.cfg index 6416238b..dfb19866 100644 --- a/qemu/tests/cfg/qemu_cpu.cfg +++ b/qemu/tests/cfg/qemu_cpu.cfg @@ -3,157 +3,145 @@ type = cpuid start_vm = "no" smp = 1 + # uncomment the following line if you don't have a RHEL-6 QEMU: + #no rhel64 variants: - - rhel64.kvm.check_models: - cpu_models = "qemu64 phenom core2duo kvm64 qemu32" - cpu_models += " coreduo 486 pentium pentium2" - cpu_models += " pentium3 athlon n270 Conroe Penryn" - cpu_models += " Nehalem Westmere SandyBridge Haswell" - cpu_models += " Opteron_G1 Opteron_G2 Opteron_G3" - cpu_models += " Opteron_G4 Opteron_G5" - cpu_models += " cpu64-rhel6 cpu64-rhel5" + - check_models: test_type = "test_qemu_cpu_models_list" - - qemu13.kvm.check_models: cpu_models = "qemu64 phenom core2duo kvm64 qemu32" - cpu_models += " kvm32 coreduo 486 pentium pentium2" + #FIXME: reorder the code to make it cleaner, put the host-specific + # models at the end of the list + variants: + - rhel64: + - qemu13: + cpu_models += " kvm32" + cpu_models += " coreduo 486 pentium pentium2" cpu_models += " pentium3 athlon n270 Conroe Penryn" cpu_models += " Nehalem Westmere SandyBridge Haswell" cpu_models += " Opteron_G1 Opteron_G2 Opteron_G3" cpu_models += " Opteron_G4 Opteron_G5" - test_type = "test_qemu_cpu_models_list" - - qemu13.kvm.cpuid.default.vendor: - # 486 is exculded due to not supporting cpuid - ignore_cpu_models = "486" - # if 'vendor' is missing then host's vendor value is used - # kvm by default overides vendor with host's value - test_type = "default_vendor" - - qemu13.nokvm.cpuid.default.vendor.intel: - disable_kvm = "yes" - enable_kvm = "no" - ignore_cpu_models = "486" - cpu_models = "core2duo kvm64 qemu32" - cpu_models += " coreduo pentium pentium2" - cpu_models += " pentium3 n270 Conroe Penryn" - cpu_models += " Nehalem Westmere SandyBridge Haswell" - vendor = "GenuineIntel" - test_type = "default_vendor" - - qemu13.nokvm.cpuid.default.vendor.amd: - disable_kvm = "yes" - enable_kvm = "no" - cpu_models = "qemu64 phenom athlon" - cpu_models += " Opteron_G1 Opteron_G2 Opteron_G3" - cpu_models += " Opteron_G4 Opteron_G5" - vendor = "AuthenticAMD" - test_type = "default_vendor" - - rhel64.kvm.cpuid.default.vendor: - # 486 is exculded due to not supporting cpuid - ignore_cpu_models = "486" - # host vendor due to override with kvm - vendor = "GenuineIntel" - test_type = "default_vendor" - - rhel64.nokvm.cpuid.default.vendor.intel: - disable_kvm = "yes" - enable_kvm = "no" - # 486 is exculded due to not supporting cpuid - cpu_models = "core2duo kvm64 qemu32" - cpu_models += " coreduo pentium pentium2" - cpu_models += " pentium3 n270 Conroe Penryn" - cpu_models += " Nehalem Westmere SandyBridge Haswell" - vendor = "GenuineIntel" - test_type = "default_vendor" - - rhel64.nokvm.cpuid.default.vendor.amd: - disable_kvm = "yes" - enable_kvm = "no" - # 486 is exculded due to not supporting cpuid - cpu_models = "qemu64 phenom athlon" - cpu_models += " Opteron_G1 Opteron_G2 Opteron_G3" - cpu_models += " Opteron_G4 Opteron_G5" - cpu_models += " cpu64-rhel6 cpu64-rhel5" - vendor = "AuthenticAMD" + rhel64: + cpu_models += " cpu64-rhel6 cpu64-rhel5" + - default.vendor: test_type = "default_vendor" - - cpuid.custom.vendor: - vendor = "QWERasdfZXCV" - test_type = "custom_vendor" - - cpuid.custom.vendor.too_short: - xfail = "yes" - vendor = "Q" - test_type = "custom_vendor" - - cpuid.custom.vendor.empty: - xfail = "yes" - vendor = "" - test_type = "custom_vendor" - - cpuid.custom.level: - level = 5 - test_type = "custom_level" - - cpuid.custom.level.NaN: - xfail = "yes" - level = "five" - test_type = "custom_level" - - cpuid.custom.family: - family = 6 - test_type = "custom_family" - - cpuid.custom.family.ext: - family = 21 - test_type = "custom_family" - - cpuid.custom.family.max: - # 0xff + 0xf = 270 - family = 270 - test_type = "custom_family" - - cpuid.custom.family.NaN: - xfail = "yes" - family = foo - test_type = "custom_family" - - cpuid.custom.family.out_of_range: - xfail = "yes" - family = 271 - test_type = "custom_family" - - cpuid.custom.model: - model = 15 - test_type = "custom_model" - - cpuid.custom.model.max: - model = 255 - test_type = "custom_model" - - cpuid.custom.model.out_of_range: - xfail = "yes" - model = 256 - test_type = "custom_model" - - cpuid.custom.model.NaN: - xfail = "yes" - model = foo - test_type = "custom_model" - - cpuid.custom.stepping: - stepping = 5 - test_type = "custom_stepping" - - cpuid.custom.stepping.max: - stepping = 15 - test_type = "custom_stepping" - - cpuid.custom.stepping.out_of_range: - xfail = "yes" - stepping = 16 - test_type = "custom_stepping" - - cpuid.custom.stepping.Nan: - xfail = "yes" - stepping = foo - test_type = "custom_stepping" - - cpuid.custom.xlevel.fixup: - # fix me when fixup in QEMU is removed - xlevel = 5 - # expect fixup to 0x80000005 - expect_xlevel = 2147483653 - test_type = "custom_xlevel" - - cpuid.custom.xlevel: - # xlevel = 0x80000001 - xlevel = 2147483649 - test_type = "custom_xlevel" - - cpuid.custom.xlevel.supported_max: - # xlevel = 0x8000000A - xlevel = 2147483658 - test_type = "custom_xlevel" - - cpuid.custom.xlevel.Nan: - xfail = "yes" - xlevel = foo - test_type = "custom_xlevel" - - cpuid.custom.model_id: - model_id = "QEMU CPU Brand by virt-test" - test_type = "custom_model_id" - + variants: + - kvm: + # when KVM is enabled, all CPU models have vendor set + # to match host, by default + # 486 is excluded due to not supporting cpuid + ignore_cpu_models = "486" + # if 'vendor' is missing then host's vendor value is used + # kvm by default overides vendor with host's value + rhel64: + #FIXME: shouldn't be set + vendor = "GenuineIntel" + - nokvm: + enable_kvm = "no" + disable_kvm = "yes" + variants: + - intel: + vendor = "GenuineIntel" + cpu_models = "core2duo kvm64 qemu32" + cpu_models += " coreduo pentium pentium2" + cpu_models += " pentium3 n270 Conroe Penryn" + cpu_models += " Nehalem Westmere" + cpu_models += " SandyBridge Haswell" + qemu13: + #FIXME: not necessary + ignore_cpu_models = "486" + - amd: + vendor = "AuthenticAMD" + cpu_models = "qemu64 phenom athlon" + cpu_models += " Opteron_G1 Opteron_G2" + cpu_models += " Opteron_G3 Opteron_G4" + cpu_models += " Opteron_G5" + rhel64: + cpu_models += " cpu64-rhel6 cpu64-rhel5" + variants: + #FIXME: we don't need rhel64/qemu13 variants for the kvm default vendor test + - qemu13: + - rhel64: + # CPUID data tests: + - cpuid.custom: + variants: + - vendor: + test_type = "custom_vendor" + variants: + - normal: + vendor = "QWERasdfZXCV" + - tooshort: + vendor = "Q" + xfail = "yes" + - empty: + xfail = "yes" + vendor = "" + - level: + test_type = "custom_level" + variants: + - level5: + level = 5 + - NaN: + xfail = "yes" + level = "five" + - family: + test_type = "custom_family" + variants: + - family6: + family = 6 + - ext: + family = 21 + - max: + # 0xff + 0xf = 270 + family = 270 + - NaN: + xfail = "yes" + family = foo + - out_of_range: + xfail = "yes" + family = 271 + - model: + test_type = "custom_model" + variants: + - model15: + model = 15 + - max: + model = 255 + - out_of_range: + xfail = "yes" + model = 256 + - NaN: + xfail = "yes" + model = foo + - stepping: + test_type = "custom_stepping" + variants: + - stepping5: + stepping = 5 + - max: + stepping = 15 + - out_of_range: + xfail = "yes" + stepping = 16 + - Nan: + xfail = "yes" + stepping = foo + - xlevel: + test_type = "custom_xlevel" + variants: + - fixup: + # fix me when fixup in QEMU is removed + xlevel = 5 + # expect fixup to 0x80000005 + expect_xlevel = 2147483653 + - level80000001: + # xlevel = 0x80000001 + xlevel = 2147483649 + - supported_max: + # xlevel = 0x8000000A + xlevel = 2147483658 + - Nan: + xfail = "yes" + xlevel = foo + - model_id: + test_type = "custom_model_id" + model_id = "QEMU CPU Brand by virt-test" -- GitLab