Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External snapshot deletion failure modification! #5177

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libvirt/tests/src/virsh_cmd/snapshot/virsh_snapshot_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def run(test, params, env):
session.close()

# Test delete snapshot without "--metadata", delete external disk
# snapshot will fail for now.
# External snapshot deletion support added in libvirt_version >= 9.0.0
# Only do this when snapshot create succeed which filtered in cfg file.
if snapshot_del_test:
if snapshot_name:
Expand All @@ -439,7 +439,7 @@ def run(test, params, env):
test.fail("Snapshot xml file %s missing"
% snap_xml_path)
else:
if status_error:
if (not libvirt_version.version_compare(9, 0, 0)) and status_error:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this check also work for libvirt 9.1.0? Can we make it generic?

if libvirt_version < 9.0.0 and status error
fail(...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sacsant It will work for all the libvirt_version because the version compare will take the libvirt version and then check whether it is greater than to the specified libvirt version or not then will return true or false accordingly!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, then we are good with the proposed changes.

err_msg = "Snapshot delete succeed but expect fail."
test.fail(err_msg)
else:
Expand Down
Loading