qemu/tests/migration.py: Ignore background command kill failures at cleanup

If the cleanup command returns 1 on Linux, it means
the migrate background process is already gone, and
a failure already happened in that particular migration
test.

So, just ignore this specific failure at the cleanup
stage. The problem is that under windows, the appropriate
error code is 128 [1]. So we have to make the ignore error
code configurable, and change the windows config file in
virt-test (on a separate PR).

[1] http://www.symantec.com/connect/forums/error-128-during-script-executionSigned-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 c24a94fa
......@@ -213,9 +213,17 @@ def run(test, params, env):
# Kill the background process
if session2 and session2.is_alive():
bg_kill_cmd = params.get("migration_bg_kill_command", None)
ignore_status = params.get("migration_bg_kill_ignore_status", 1)
if bg_kill_cmd is not None:
try:
session2.cmd(bg_kill_cmd)
except aexpect.ShellCmdError, details:
# If the migration_bg_kill_command rc differs from
# ignore_status, it means the migration_bg_command is
# no longer alive. Let's ignore the failure here if
# that is the case.
if not int(details.status) == int(ignore_status):
raise
except aexpect.ShellTimeoutError:
logging.debug("Remote session not responsive, "
"shutting down VM %s", vm.name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册