提交 b65d99b6 编写于 作者: X Xueqiang Wei

fix lack_flag_check.unknown_flag

1. The behavior is different after run "-cpu 'model_name',+unknown,check"
   between RHEL7 and RHEL6
   (after qemu output "CPU feature unknown not found" qemu exit in RHEL7,
    but qemu not exit in RHEL6)
2. The behavior in RHEL6 is not the one we really want, but it's
   just an usability issue (as using invalid flag names is not supported),
   so developper didn't backport the fix to RHEL6.
3. in auto script, add check point:
   qemu output "CPU feature unknown not found"
Signed-off-by: NXueqiang Wei <xuwei@redhat.com>
上级 afc12362
......@@ -26,6 +26,8 @@
out_flags += " x2apic"
variants:
- unknown_flag:
start_vm = no
qemu_output = "CPU feature unknown not found"
cpu_model_flags = ",+unknown,check"
- unsupported_flags:
cpu_model_flags = ",+sse4a,+aes,+ssse3,+sse4.2,check"
......
......@@ -6,6 +6,7 @@ from autotest.client.shared import utils, error
from virttest import utils_misc
from virttest import data_dir
from virttest import virt_vm
@error.context_aware
......@@ -139,6 +140,22 @@ def run(test, params, env):
error.context("Boot guest with -cpu %s,%s" %
(guest_cpumodel, extra_flags), logging.info)
if params.get("start_vm") == "no" and "unknown,check" in extra_flags:
params["start_vm"] = "yes"
try:
vm.create()
except virt_vm.VMCreateError, detail:
error.context("qemu process is defunct.%s" % detail, logging.info)
finally:
if vm.is_alive():
process_output = vm.process.get_output()
else:
process_output = str(detail)
if params["qemu_output"] not in process_output:
raise error.TestFail("no qemu output: %s" % params["qemu_output"])
vm.destroy()
else:
vm.verify_alive()
timeout = float(params.get("login_timeout", 240))
session = vm.wait_for_login(timeout=timeout)
......@@ -193,7 +210,7 @@ def run(test, params, env):
host_flags = set(map(utils_misc.Flag, host_flags))
lack_flags = set(expected_flags | check_flags) - host_flags
if "check" in extra_flags:
if "check" in extra_flags and "unknown" not in extra_flags:
error.context("Check lack flag in host", logging.info)
process_output = vm.process.get_output()
miss_warn = []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册