提交 f84b12c5 编写于 作者: C Cong 提交者: GitHub

Merge pull request #716 from CongLi/transaction

qemu.tests: Add case for successful live snapshot transaction.
......@@ -81,3 +81,12 @@
- existing_mode:
snapshot_mode = "existing"
match_str = "Could not open '%s': No such file or directory"
- transaction:
type = live_snapshot_transaction
images += " sn1 sn2"
image_name_sn1 = "images/sn1"
image_name_sn2 = "images/sn2"
check_base_image = yes
force_create_image = yes
force_create_image_image1 = no
after_finished = "reboot verify_alive"
import logging
from autotest.client.shared import error
from qemu.tests import live_snapshot_basic
@error.context_aware
def run(test, params, env):
"""
live_snapshot_transaction test:
1. Boot up guest with a system disk and 2 data disk.
2. Create multiple live snapshots simultaneously for all 3 disks with transaction.
3. Check guest which should boot up and reboot successfully.
:param test: Kvm test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
arg_list = []
try:
for image in params.objects("images"):
image_params = params.object_params(image)
transaction_test = live_snapshot_basic.LiveSnapshot(test,
image_params,
env, image)
transaction_test.snapshot_args.update({"device": transaction_test.device})
transaction_test.snapshot_file = image + "-snap"
snapshot_file = transaction_test.get_snapshot_file()
transaction_test.snapshot_args.update({"snapshot-file": snapshot_file})
args = {"type": "blockdev-snapshot-sync",
"data": transaction_test.snapshot_args}
arg_list.append(args)
error.context("Create multiple live snapshots simultaneously"
" with transaction", logging.info)
output = transaction_test.vm.monitor.transaction(arg_list)
# return nothing on successful transaction
if bool(output):
raise error.TestFail("Live snapshot transatcion failed,"
" there should be nothing on success.\n"
"More details: %s" % output)
transaction_test.action_after_finished()
finally:
try:
transaction_test.clean()
except Exception:
pass
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册