From d6746ad043538d8be1a6f1f900377ac76c7c0b39 Mon Sep 17 00:00:00 2001 From: Yalan Zhang Date: Tue, 10 Dec 2024 07:02:49 -0500 Subject: [PATCH] Fix managedsave cases about fake managed file Delete one case 'not_saved_with_file' as the bug https://bugzilla.redhat.com/show_bug.cgi?id=1689809 is closed as won't fix, so it's not a valid test scenario. And update one parameter in the file. Signed-off-by: Yalan Zhang --- libvirt/tests/cfg/virsh_cmd/domain/virsh_managedsave.cfg | 2 -- libvirt/tests/src/virsh_cmd/domain/virsh_managedsave.py | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libvirt/tests/cfg/virsh_cmd/domain/virsh_managedsave.cfg b/libvirt/tests/cfg/virsh_cmd/domain/virsh_managedsave.cfg index 7c76314349..8a05992ed0 100644 --- a/libvirt/tests/cfg/virsh_cmd/domain/virsh_managedsave.cfg +++ b/libvirt/tests/cfg/virsh_cmd/domain/virsh_managedsave.cfg @@ -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: diff --git a/libvirt/tests/src/virsh_cmd/domain/virsh_managedsave.py b/libvirt/tests/src/virsh_cmd/domain/virsh_managedsave.py index 3ae522e1b6..770d7f64d6 100644 --- a/libvirt/tests/src/virsh_cmd/domain/virsh_managedsave.py +++ b/libvirt/tests/src/virsh_cmd/domain/virsh_managedsave.py @@ -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" @@ -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 @@ -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"