Skip to content

Commit 26b4054

Browse files
authored
guest_agent: Domfsfreeze domfsthaw fix (#6549)
* domfsfreeze_domfsthaw: Add a fail pattern for frozen state check When vm is in frozen state, running a agent command should fail with clear error message. The error message varies depending on the libvirt and qemu versions. The previos fail patterns misses the error message on RHEL9.0 * domfsfreeze_domfsthaw: Thaw vm filesystems before cleanup If the test fails between domfsfreeze and domfsthaw, cleanup will fail because it tries to remove files in vm when vm is frozen.
1 parent 2719032 commit 26b4054

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libvirt/tests/src/virsh_cmd/domain/virsh_domfsfreeze_domfsthaw.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ def run_agent_command_when_frozen(vm_name, command_name="domtime"):
136136
"""
137137
test.log.info("TEST_STEP: Run qemu guest agent command when frozen.")
138138
fail_patts = [
139-
r"error: guest agent command failed: unable to execute QEMU agent command '\S+': Command guest-get-time has been disabled: the command is not allowed",
140-
r"error: internal error: unable to execute QEMU agent command '\S+': Command guest-get-time has been disabled: the command is not allowed",
139+
r"error: guest agent command failed: unable to execute QEMU agent command '\S+': Command \S+ has been disabled: the command is not allowed",
140+
r"error: internal error: unable to execute QEMU agent command '\S+': Command \S+ has been disabled: the command is not allowed",
141+
r"error: internal error: unable to execute QEMU agent command '\S+': Command \S+ has been disabled: the agent is in frozen state",
141142
]
142143

143144
virsh_command = eval("virsh.%s" % command_name)
@@ -240,6 +241,7 @@ def cleanup(session, mountpoints, test_file):
240241
check_thaw(session, freezed_mountpoints, test_file)
241242
run_agent_command_when_thawed(vm_name)
242243
finally:
244+
virsh.domfsthaw(vm_name, ignore_status=True)
243245
cleanup(session, freezed_mountpoints, test_file)
244246
session.close()
245247
finally:

0 commit comments

Comments
 (0)