提交 740a7216 编写于 作者: J Jiří Župka 提交者: Lucas Meneghel Rodrigues

virt: Adds suspend multi-host tests.

This patch slightly changes structure of basic multihost test
and adds possibility for start sub_test after main migration test.
Signed-off-by: NJiří Župka <jzupka@redhat.com>
上级 31cf810c
......@@ -184,6 +184,16 @@
- short_interrupt:
sub_type = short_interrupt
- suspend:
type = migration_multi_host
sub_test = "guest_suspend"
variants:
- guest_s3:
guest_suspend_type = "mem"
services_up_timeout = 30
- guest_s4:
guest_suspend_type = "disk"
- cdrom_test:
only Linux
only mig_online.after_login_vm
......
......@@ -15,28 +15,26 @@ def run_migration_multi_host(test, params, env):
@param params: Dictionary with test parameters.
@param env: Dictionary with the test environment.
"""
login_timeout = int(params.get("login_timeout", 360))
sub_test = params.get("sub_test")
mig_protocol = params.get("mig_protocol", "tcp")
base_class = utils_test.MultihostMigration
mig_type = utils_test.MultihostMigration
if mig_protocol == "fd":
base_class = utils_test.MultihostMigrationFd
mig_type = utils_test.MultihostMigrationFd
if mig_protocol == "exec":
base_class = utils_test.MultihostMigrationExec
class TestMultihostMigration(base_class):
def __init__(self, test, params, env):
super(TestMultihostMigration, self).__init__(test, params, env)
self.srchost = self.params.get("hosts")[0]
self.dsthost = self.params.get("hosts")[1]
self.vms = params.get("vms").split()
mig_type = utils_test.MultihostMigrationExec
def migration_scenario(self, worker=None):
error.context("Migration from %s to %s over protocol %s." %
(self.srchost, self.dsthost, mig_protocol),
logging.info)
self.migrate_wait(self.vms, self.srchost, self.dsthost,
start_work=worker)
vms = params.get("vms").split(" ")
srchost = params["hosts"][0]
dsthost = params["hosts"][1]
is_src = params["hostid"] == srchost
mig = mig_type(test, params, env, False)
mig.migrate_wait([vms[0]], srchost, dsthost)
mig = TestMultihostMigration(test, params, env)
mig.run()
if not is_src: #is destination
if sub_test:
error.context("Run sub test '%s' after checking"
" clock resolution" % sub_test, logging.info)
utils_test.run_virt_sub_test(test, params, env, sub_test)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册