From 4f82b71aa9106c49b302fd0a774f8dcd31e2b4b4 Mon Sep 17 00:00:00 2001 From: Xu Tian Date: Mon, 12 Aug 2013 14:08:18 +0800 Subject: [PATCH] qemu.tests: update test script according test case updated test script since case steps changed; Signed-off-by: Xu Tian --- qemu/tests/block_copy.py | 1 + qemu/tests/block_stream_reboot.py | 25 ++++++++----------------- qemu/tests/cfg/block_stream.cfg | 2 +- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/qemu/tests/block_copy.py b/qemu/tests/block_copy.py index d5de8dcc..c0520330 100644 --- a/qemu/tests/block_copy.py +++ b/qemu/tests/block_copy.py @@ -160,6 +160,7 @@ class BlockCopy(object): """ reboot VM, alias of vm.reboot(); """ + error.context("reboot vm", logging.info) params = self.parser_test_args() timeout = params["login_timeout"] diff --git a/qemu/tests/block_stream_reboot.py b/qemu/tests/block_stream_reboot.py index f7592bf7..26557e3e 100644 --- a/qemu/tests/block_stream_reboot.py +++ b/qemu/tests/block_stream_reboot.py @@ -1,4 +1,3 @@ -import logging from autotest.client.shared import error, utils from qemu.tests import blk_stream @@ -11,20 +10,13 @@ class BlockStreamReboot(blk_stream.BlockStream): @error.context_aware - def start_reset(self): + def reboot(self): """ - Reset guest with system_reset in loop; + Reset guest with system_reset; """ - error.context("reset guest in loop", logging.info) - count = 0 - while True: - self.reboot(method="system_reset", boot_check=False) - count +=1 - status = self.get_status() - # if block stream job really started, stop reset loop - if status.get("offset", 0) > 0: - break - logging.info("has reset %s times, when start stream job" % count) + params = self.parser_test_args() + method = params.get("reboot_method", "system_reset") + return super(BlockStreamReboot, self).reboot(method=method) def action_before_start(self): @@ -53,10 +45,9 @@ class BlockStreamReboot(blk_stream.BlockStream): def run_block_stream_reboot(test, params, env): """ block_stream_reboot test: - 1). boot up vm and create snapshots; - 2). reboot guest, then start block steam job; - 3). destroy live vm and create it, then start block stream job(optonal); - 4). after stream done, then reboot guest and check it's alived + 1). boot guest, then reboot guest with system_reset; + 2). create snapshots and start stream job immediately; + 3). waiting stream done and check guest is alive; @param test: Kvm test object @param params: Dictionary with the test parameters diff --git a/qemu/tests/cfg/block_stream.cfg b/qemu/tests/cfg/block_stream.cfg index 90ed2891..ad33ae6d 100644 --- a/qemu/tests/cfg/block_stream.cfg +++ b/qemu/tests/cfg/block_stream.cfg @@ -42,7 +42,7 @@ type = block_stream_reboot reboot_method = "system_reset" before_start = "reboot" - after_finished = "reboot verify_alive" + after_finished = "verify_alive" - drop_backingfile: snapshot_chain += " images/sn2" type = block_stream_drop_backingfile -- GitLab