未验证 提交 f3db11cf 编写于 作者: X Xu Han 提交者: GitHub

Merge pull request #1032 from xiangchunfu/qemu_guest_agent

qemu_guest_agent: add new guest agent case
......@@ -113,6 +113,8 @@
no Windows
gagent_check_type = fsfreeze
gagent_fs_test_cmd = "rm -f /tmp/foo; echo foo > /tmp/foo"
- check_reboot_shutdown_fsfreeze:
gagent_check_type = reboot_shutdown
- check_snapshot:
# fsfreeze series commands can't run on windows guest.
type = qemu_guest_agent_snapshot
......
......@@ -811,6 +811,33 @@ class QemuGuestAgentBasicCheck(QemuGuestAgentTest):
else:
self.test.fail("FS is not frozen,still can write in guest.")
def gagent_check_reboot_shutdown(self, test, params, env):
"""
Send "shutdown,reboot" command to guest agent
after FS freezed
:param test: kvm test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
vm = env.get_vm(params["main_vm"])
vm.verify_alive()
gagent = self.gagent
gagent.fsfreeze()
try:
for mode in (gagent.SHUTDOWN_MODE_POWERDOWN, gagent.SHUTDOWN_MODE_REBOOT):
try:
gagent.shutdown(mode)
except guest_agent.VAgentCmdError as detail:
if not re.search('guest-shutdown has been disabled', str(detail)):
test.fail("This is not the desired information: ('%s')" % str(detail))
else:
test.fail("agent shutdown command shouldn't succeed for freeze FS")
finally:
try:
gagent.fsthaw(check_status=False)
except Exception:
pass
@error_context.context_aware
def _action_before_fsthaw(self, *args):
pass
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册