Skip to content

Commit

Permalink
Merge pull request #4154 from 6-dehan/KVMAUTOMA-2868-frozen-message-o…
Browse files Browse the repository at this point in the history
…ptimize

qemu_guest_agent: Report message changed for api qga-freeze
  • Loading branch information
vivianQizhu authored Oct 18, 2024
2 parents c54afbe + f9aaf16 commit e512038
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions qemu/tests/qemu_guest_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2600,13 +2600,19 @@ def gagent_check_freeze_frozen(self, test, params, env):
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
# Since Qemu9.1, the report message changes.
qga_ver = self.gagent.guest_info()["version"].split('.')
main_qga_ver = float("{}.{}".format(qga_ver[0], qga_ver[1]))
expected = (
"Command guest-fsfreeze-freeze has been disabled: "
f"{'the command is not allowed' if 9.1 <= main_qga_ver or main_qga_ver >= 109.0 else 'the agent is in frozen state'}"
)

self.gagent.fsfreeze()
error_context.context("Freeze the frozen FS", LOG_JOB.info)
try:
self.gagent.fsfreeze(check_status=False)
except guest_agent.VAgentCmdError as e:
expected = ("Command guest-fsfreeze-freeze has been disabled: "
"the agent is in frozen state")
if expected not in e.edata["desc"]:
test.fail(e)
else:
Expand Down

0 comments on commit e512038

Please sign in to comment.