提交 2723eb7b 编写于 作者: E Eduardo Habkost 提交者: Lucas Meneghel Rodrigues

qemu/tests/cpuid: fix escaping of "-cpu ?" command

The command being run is a shell command, so running it as "-cpu ?"
without any quotes around "?" will make the shell expand "?" to the list
of filenames with one letter in the current directory.
Let's fix this by properly escaping the question mark.
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
上级 3abc6daa
......@@ -72,7 +72,7 @@ def run_cpuid(test, params, env):
"""
Get all cpu models from qemu -cpu help text.
@param qemu_cpu_help_text: text produced by <qemu> -cpu ?
@param qemu_cpu_help_text: text produced by <qemu> -cpu '?'
@return: list of cpu models
"""
......@@ -81,7 +81,7 @@ def run_cpuid(test, params, env):
class test_qemu_cpu_models_list(MiniSubtest):
"""
check CPU models returned by <qemu> -cpu ? are what is expected
check CPU models returned by <qemu> -cpu '?' are what is expected
"""
def test(self):
"""
......@@ -91,7 +91,7 @@ def run_cpuid(test, params, env):
raise error.TestNAError("define cpu_models parameter to check "
"supported CPU models list")
cmd = qemu_binary + " -cpu ?"
cmd = qemu_binary + " -cpu '?'"
result = utils.run(cmd)
qemu_models = extract_qemu_cpu_models(result.stdout)
cpu_models = params.get("cpu_models").split()
......@@ -177,7 +177,7 @@ def run_cpuid(test, params, env):
"""
def test(self):
if params.get("cpu_models") is None:
cmd = qemu_binary + " -cpu ?"
cmd = qemu_binary + " -cpu '?'"
result = utils.run(cmd)
cpu_models = set(extract_qemu_cpu_models(result.stdout))
else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册