From 740a72169bf35993ba0eb8617641aa290a2841d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=BDupka?= Date: Thu, 9 May 2013 17:12:22 +0200 Subject: [PATCH] virt: Adds suspend multi-host tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch slightly changes structure of basic multihost test and adds possibility for start sub_test after main migration test. Signed-off-by: Jiří Župka --- qemu/tests/cfg/multi_host.cfg | 10 +++++++++ qemu/tests/migration_multi_host.py | 36 ++++++++++++++---------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/qemu/tests/cfg/multi_host.cfg b/qemu/tests/cfg/multi_host.cfg index 3bcc4f1d..5e22ded1 100644 --- a/qemu/tests/cfg/multi_host.cfg +++ b/qemu/tests/cfg/multi_host.cfg @@ -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 diff --git a/qemu/tests/migration_multi_host.py b/qemu/tests/migration_multi_host.py index 7481f3fb..0c62aae1 100644 --- a/qemu/tests/migration_multi_host.py +++ b/qemu/tests/migration_multi_host.py @@ -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) -- GitLab