Skip to content

Commit

Permalink
Merge pull request autotest#4148 from aliang123/2856
Browse files Browse the repository at this point in the history
blockdev_snapshot_data_file: support raw elimination
  • Loading branch information
XueqiangWei authored Sep 23, 2024
2 parents 2943888 + f3834c3 commit 1c56878
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions qemu/tests/blockdev_snapshot_data_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from virttest import error_context
from virttest import data_dir
from virttest.qemu_capabilities import Flags

from provider import backup_utils
from provider.blockdev_snapshot_base import BlockDevSnapshotTest
Expand Down Expand Up @@ -32,8 +33,14 @@ def check_data_file_in_block_info(self):
data_file_tag = self.params["image_data_file_%s" % self.snapshot_tag]
data_file_image = self.get_image_by_tag(data_file_tag)
data_file = eval(filename.lstrip("json:"))["data-file"]
if data_file["file"]["filename"] != data_file_image.image_filename:
self.test.fail("data-file info is not as expected: %s" % data_file_image)
if self.main_vm.check_capability(
Flags.BLOCKJOB_BACKING_MASK_PROTOCOL):
data_filename = data_file["filename"]
else:
data_filename = data_file["file"]["filename"]
if data_filename != data_file_image.image_filename:
self.test.fail("data-file info is not as expected: %s"
% data_file_image.image_filename)
break
else:
self.test.fail("Data-file option not included in block info")
Expand Down

0 comments on commit 1c56878

Please sign in to comment.