提交 37c5f88c 编写于 作者: X Xiangchun Fu

qemu_guest_agent: add new guest agent case

1.frozen guest FS
2.send shutdown agent cmd to guest
3.send reboot agent cmd to guest
4.send fsthaw cmd to guest
Signed-off-by: NXiangchun Fu <xfu@redhat.com>
上级 262a0dfc
...@@ -109,6 +109,8 @@ ...@@ -109,6 +109,8 @@
no Windows no Windows
gagent_check_type = fsfreeze gagent_check_type = fsfreeze
gagent_fs_test_cmd = "rm -f /tmp/foo; echo foo > /tmp/foo" gagent_fs_test_cmd = "rm -f /tmp/foo; echo foo > /tmp/foo"
- check_reboot_shutdown_fsfreeze:
gagent_check_type = reboot_shutdown
- check_snapshot: - check_snapshot:
# fsfreeze series commands can't run on windows guest. # fsfreeze series commands can't run on windows guest.
type = qemu_guest_agent_snapshot type = qemu_guest_agent_snapshot
......
...@@ -810,6 +810,33 @@ class QemuGuestAgentBasicCheck(QemuGuestAgentTest): ...@@ -810,6 +810,33 @@ class QemuGuestAgentBasicCheck(QemuGuestAgentTest):
else: else:
self.test.fail("FS is not frozen,still can write in guest.") 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 @error_context.context_aware
def _action_before_fsthaw(self, *args): def _action_before_fsthaw(self, *args):
pass pass
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册