提交 7adfdd4f 编写于 作者: X Xiaoling Gao

qemu_guest_agent: check agent status when no user logged in

new case of cheing guest agent status when no user login,only
for windows guest.
Signed-off-by: NXiaoling Gao <xiagao@redhat.com>
上级 7866bcb9
......@@ -279,6 +279,9 @@
only virtio_serial
gagent_check_type = with_migrate
mig_speed = 512M
- gagent_user_logoff:
only Windows
gagent_check_type = user_logoff
variants:
- virtio_serial:
gagent_serial_type = virtio
......
......@@ -2124,6 +2124,34 @@ class QemuGuestAgentBasicCheck(QemuGuestAgentTest):
disk_index):
test.fail("Can't online disk with fsthaw")
@error_context.context_aware
def gagent_check_user_logoff(self, test, params, env):
"""
Check guest agent status when user is logged out.
:param test: kvm test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
session = self._get_session(params, None)
self._open_session_list.append(session)
error_context.context("Check which user is logged in.", logging.info)
user_info = session.cmd_output('query user | findstr /i "Active"')
login_user_id = user_info.strip().split()[2]
error_context.context("Make the user log out.", logging.info)
try:
session.cmd("logoff %s" % login_user_id)
except aexpect.ShellProcessTerminatedError as detail:
if not re.search("Connection reset by peer", str(detail)):
test.error("Error occured with %s." % str(detail))
else:
test.fail("The user logoff failed.")
error_context.context("Verify if guest agent works.", logging.info)
self.gagent_verify(self.params, self.vm)
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.
先完成此消息的编辑!
想要评论请 注册