Skip to content

Commit 020d77a

Browse files
committed
Small update of the test recovery, so the error in the recovery will not replace original test error message
1 parent 0389064 commit 020d77a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

libvirt/tests/src/migration/migrate_vm.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2434,14 +2434,14 @@ def get_target_hugepage_num(params):
24342434

24352435
try:
24362436
remote_virsh_session = virsh.VirshPersistent(**remote_virsh_dargs)
2437-
logging.debug("Check if remote guest exists")
2437+
logging.debug("TEST_STEP: Check if remote guest exists")
24382438
if remote_virsh_session.domain_exists(target_vm_name) is False:
24392439
test.cancel("The guest '%s' on remote '%s' should be "
24402440
"installed before the test."
24412441
% (target_vm_name, server_ip))
24422442
# Check the prepared guest state on remote host.
24432443
# 'shut off' is expected.
2444-
logging.debug("Check if remote guest is in shutoff")
2444+
logging.debug(f"TEST_STEP: Check if remote guest is not alive")
24452445
if remote_virsh_session.is_alive(target_vm_name):
24462446
test.error("The guest '%s' on remote "
24472447
"'%s' should not be alive."
@@ -2735,7 +2735,7 @@ def get_target_hugepage_num(params):
27352735
% (cmd, output))
27362736

27372737
finally:
2738-
logging.info("Recovery test environment")
2738+
logging.info("TEST_RECOVERY: Recovery test environment")
27392739

27402740
logging.debug("Removing vm on remote if it exists.")
27412741
virsh.remove_domain(vm.name, options='--nvram', uri=uri)
@@ -2863,10 +2863,10 @@ def get_target_hugepage_num(params):
28632863
cleanup=True,
28642864
ports=uri_port[1:])
28652865
remote_virsh_session = virsh.VirshPersistent(**remote_virsh_dargs)
2866-
logging.debug("Destroy remote guest")
2867-
remote_virsh_session.destroy(target_vm_name)
2868-
logging.debug("Recover remote guest xml")
2869-
remote_virsh_session.define(xml_path)
2866+
logging.debug("TEST_RECOVERY: Destroy remote guest")
2867+
remote_virsh_session.destroy(target_vm_name, ignore_status=True)
2868+
logging.debug("TEST_RECOVERY: Recover remote guest xml")
2869+
remote_virsh_session.define(xml_path, ignore_status=True)
28702870
except (process.CmdError, remote.SCPError) as detail:
28712871
test.error(detail)
28722872
finally:

0 commit comments

Comments
 (0)