提交 1a6a3f3a 编写于 作者: L Lukáš Doktor 提交者: Lucas Meneghel Rodrigues

kvm.virtio_console: Add new test failed_boot

This patch adds new test failed_boot. It tries to create VM
and checks the error message.

As an example boot_nr0 test is added to cfg. It tries to create
VM with virtio port number = 0 (nr=0) which should fail due
to backward compatibility issue.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 d8f45239
......@@ -1321,6 +1321,26 @@ def run_virtio_console(test, params, env):
for port in vm.virtio_ports:
port.close()
def test_failed_boot():
"""
Start VM and check if it failed with the right error message.
@param cfg: virtio_console_params - Expected error message.
"""
exp_error_message = params.get('virtio_console_params')
env_process.preprocess(test, params, env)
vm = env.get_vm(params["main_vm"])
try:
vm.create()
except Exception, details:
if exp_error_message in str(details):
logging.info("Expected qemu failure. Test PASSED.")
return
else:
raise error.TestFail("VM failed to start but error messages "
"don't match.\nExpected:\n%s\nActual:\n%s"
% (exp_error_message, details))
raise error.TestFail("VM started even though it should fail.")
######################################################################
# Debug and dummy tests
######################################################################
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册