提交 44f28dcf 编写于 作者: D Dr. David Alan Gilbert

Skip test if a migration capability isn't available

If a test tries to use a migration capability that doesn't exist
in that version of QEMU or can't be used in combination with some
other setting then we'll get an exception.  Trap this exception
and cause the test to be skipped.
Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
上级 aa95b9a4
......@@ -10,6 +10,7 @@ from virttest import utils_misc
from virttest import utils_test
from virttest import utils_package
from virttest import error_context
from virttest import qemu_monitor # For MonitorNotSupportedMigCapError
@error_context.context_aware
......@@ -217,13 +218,18 @@ def run(test, params, env):
logging.info("Round %s ping..." % str(i / 2))
else:
logging.info("Round %s pong..." % str(i / 2))
vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay,
offline, check,
migration_exec_cmd_src=mig_exec_cmd_src,
migration_exec_cmd_dst=mig_exec_cmd_dst,
migrate_capabilities=capabilities,
mig_inner_funcs=inner_funcs,
env=env)
try:
vm.migrate(mig_timeout, mig_protocol, mig_cancel_delay,
offline, check,
migration_exec_cmd_src=mig_exec_cmd_src,
migration_exec_cmd_dst=mig_exec_cmd_dst,
migrate_capabilities=capabilities,
mig_inner_funcs=inner_funcs,
env=env)
except qemu_monitor.MonitorNotSupportedMigCapError as e:
test.cancel("Unable to access capability: %s" % e)
except:
raise
# Set deamon thread action to stop after migrate
params["action"] = "stop"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册