Skip to content

Commit

Permalink
Merge pull request #6054 from yalzhang/fix_managedsave_with_file
Browse files Browse the repository at this point in the history
Fix managedsave cases about fake managed file
  • Loading branch information
chloerh authored Dec 11, 2024
2 parents 0fe829f + d6746ad commit 028cf5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions libvirt/tests/cfg/virsh_cmd/domain/virsh_managedsave.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@
- rm_test:
remove_test = 'yes'
variants:
- not_saved_with_file:
case = 'not_saved_with_file'
- not_saved_without_file:
case = 'not_saved_without_file'
- saved_without_file:
Expand Down
6 changes: 4 additions & 2 deletions libvirt/tests/src/virsh_cmd/domain/virsh_managedsave.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def vm_recover_check(option, libvirtd, check_shutdown=False):
" paused after started"
" because of '--paused' option")
else:
if params.get("paused_after_start_vm") == "yes":
if paused_after_start_vm:
if not vm.is_paused():
test.fail("Guest state should be"
" paused after started"
Expand Down Expand Up @@ -337,6 +337,7 @@ def build_vm_xml(vm_name, **dargs):
remove_test = 'yes' == params.get('remove_test', 'no')
case = params.get('case', '')
msave_rm_error = "yes" == params.get("msave_rm_error", "no")
paused_after_start_vm = "yes" == params.get('paused_after_start_vm', "no")
if option:
if not virsh.has_command_help_match('managedsave', option):
# Older libvirt does not have this option
Expand Down Expand Up @@ -428,7 +429,8 @@ def build_vm_xml(vm_name, **dargs):
elif vm_ref == "name":
vm_ref = vm_name
# Prepare the certain state before managedsave
if params.get('paused_after_start_vm'):
if paused_after_start_vm:
logging.debug("Suspend the VM!")
virsh.suspend(vm_ref)

# Ignore exception with "ignore_status=True"
Expand Down

0 comments on commit 028cf5c

Please sign in to comment.