提交 3f85364d 编写于 作者: X Xiyue Wang

block_commit: add case with_reboot and stop_cont

Signed-off-by: NXiyue Wang <xiywang@redhat.com>
上级 1607c119
import time
import random
import logging
from qemu.tests import blk_commit
class BlockCommitReboot(blk_commit.BlockCommit):
def reboot(self):
"""
Reset guest with system_reset;
"""
return super(BlockCommitReboot, self).reboot(boot_check=False)
def action_when_start(self):
"""
start pre-action in new threads;
"""
super(BlockCommitReboot, self).action_when_start()
logging.info("sleep for random time between 0 to 20, to perform "
"the block job during different stage of rebooting")
time.sleep(random.randint(0, 20))
def run(test, params, env):
"""
block_commit_reboot test:
1). boot a guest, then reboot the guest with system_reset;
2). create snapshots and start commit job immediately;
3). waiting commit done and check guest is alive;
:param test: Kvm test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
tag = params.get("source_image", "image1")
reboot_test = BlockCommitReboot(test, params, env, tag)
try:
reboot_test.action_when_start()
reboot_test.create_snapshots()
reboot_test.start()
reboot_test.action_after_finished()
finally:
try:
reboot_test.clean()
except Exception, e:
logging.warn(e)
......@@ -27,3 +27,11 @@
wait_timeout = 120
before_start = "load_stress"
after_finished = "unload_stress verify_backingfile reboot verify_alive"
- with_stop_cont:
before_start = "verify_alive stop"
after_finished = "resume reboot verify_alive"
- with_reboot:
type = block_commit_reboot
reboot_method = "system_reset"
when_start = "reboot"
after_finished = "verify_alive"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册