提交 23c0f57b 编写于 作者: Y yama

qemu_guest_agent.py: check the default path of fsfreeze-hook

Signed-off-by: Nyama <yama@redhat.com>
上级 a8b73bca
......@@ -149,6 +149,16 @@
disk_write_cmd = "dd if=/dev/zero of=%s/file bs=1M count=4"
Windows:
disk_write_cmd = "cd %s:\ && echo test > a.txt"
- check_path_fsfreeze_hook:
no Windows
gagent_check_type = path_fsfreeze_hook
gagent_help_cmd = "qemu-ga --help | grep 'fsfreeze-hook' | tail -1"
gagent_path_cmd = "rpm -ql qemu-guest-agent"
virtio_serial:
gagent_start_cmd = "qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0 -F -d"
isa_serial:
gagent_start_cmd = "pgrep qemu-ga || qemu-ga -d -m isa-serial -p /dev/ttyS1 -F"
variants:
- virtio_serial:
gagent_serial_type = virtio
......
......@@ -1009,6 +1009,34 @@ class QemuGuestAgentBasicCheck(QemuGuestAgentTest):
utils_disk.umount(new_disks[0], mnt_point[0], session=session)
session.close()
@error_context.context_aware
def gagent_check_path_fsfreeze_hook(self, test, params, env):
"""
Check if the default path of fsfreeze-hook is correct
:param test: kvm test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment
"""
session = self._get_session(params, self.vm)
self.gagent_stop(session, self.vm)
error_context.context("Start gagent with -F option", logging.info)
self.gagent_start(session, self.vm)
gagent_path_cmd = params["gagent_path_cmd"]
error_context.context("Check if default path of fsfreeze-hook is in "
"output of %s" % gagent_path_cmd, logging.info)
s, o = session.cmd_status_output(params["gagent_help_cmd"])
help_cmd_output = o.strip().replace(')', '').split()[-1]
s, o = session.cmd_status_output(gagent_path_cmd)
if help_cmd_output in o:
logging.info("The default path for script 'fsfreeze-hook' is "
"in output of %s." % gagent_path_cmd)
error_context.context("Execute 'guest-fsfreeze-freeze'", logging.info)
self.gagent.fsfreeze()
self.gagent.fsthaw()
else:
test.fail("The default path of fsfreeze-hook doesn't match with expectation.")
def run_once(self, test, params, env):
QemuGuestAgentTest.run_once(self, test, params, env)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册