diff --git a/qemu/tests/block_copy.py b/qemu/tests/block_copy.py index d5de8dcc1bb1a1585aa0bb68c322fc284ee9fcfe..c052033023e6c43559f860f456b5ed6163cc2140 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 f7592bf7ce8bf12d9deac8281fa3a5a2b8a36ad9..26557e3e746b4c0bbd83564faef230466f0b3fcb 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 90ed2891f0454fcfac7db0ec557fb8d1448caaa8..ad33ae6d05d93216fad23c1b39f506d644f458c5 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