提交 4f82b71a 编写于 作者: X Xu Tian

qemu.tests: update test script according test case

updated test script since case steps changed;
Signed-off-by: NXu Tian <xutian@redhat.com>
上级 61416900
...@@ -160,6 +160,7 @@ class BlockCopy(object): ...@@ -160,6 +160,7 @@ class BlockCopy(object):
""" """
reboot VM, alias of vm.reboot(); reboot VM, alias of vm.reboot();
""" """
error.context("reboot vm", logging.info)
params = self.parser_test_args() params = self.parser_test_args()
timeout = params["login_timeout"] timeout = params["login_timeout"]
......
import logging
from autotest.client.shared import error, utils from autotest.client.shared import error, utils
from qemu.tests import blk_stream from qemu.tests import blk_stream
...@@ -11,20 +10,13 @@ class BlockStreamReboot(blk_stream.BlockStream): ...@@ -11,20 +10,13 @@ class BlockStreamReboot(blk_stream.BlockStream):
@error.context_aware @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) params = self.parser_test_args()
count = 0 method = params.get("reboot_method", "system_reset")
while True: return super(BlockStreamReboot, self).reboot(method=method)
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)
def action_before_start(self): def action_before_start(self):
...@@ -53,10 +45,9 @@ class BlockStreamReboot(blk_stream.BlockStream): ...@@ -53,10 +45,9 @@ class BlockStreamReboot(blk_stream.BlockStream):
def run_block_stream_reboot(test, params, env): def run_block_stream_reboot(test, params, env):
""" """
block_stream_reboot test: block_stream_reboot test:
1). boot up vm and create snapshots; 1). boot guest, then reboot guest with system_reset;
2). reboot guest, then start block steam job; 2). create snapshots and start stream job immediately;
3). destroy live vm and create it, then start block stream job(optonal); 3). waiting stream done and check guest is alive;
4). after stream done, then reboot guest and check it's alived
@param test: Kvm test object @param test: Kvm test object
@param params: Dictionary with the test parameters @param params: Dictionary with the test parameters
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
type = block_stream_reboot type = block_stream_reboot
reboot_method = "system_reset" reboot_method = "system_reset"
before_start = "reboot" before_start = "reboot"
after_finished = "reboot verify_alive" after_finished = "verify_alive"
- drop_backingfile: - drop_backingfile:
snapshot_chain += " images/sn2" snapshot_chain += " images/sn2"
type = block_stream_drop_backingfile type = block_stream_drop_backingfile
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册