Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qemu_guest_agent: adjust check method for isa-serial situation #3781

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions qemu/tests/cfg/qemu_guest_agent.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,12 @@
- gagent_check_log:
only isa_serial
gagent_check_type = log
gagent_serial_type = isa
black_list = "guest-file-[a-zA-Z]*"
get_log_cmd = cat /var/log/qemu-ga/qemu-ga.log |grep "read data"
get_log_cmd = cat /var/log/qemu-ga/qemu-ga.log |grep "%s"
tmp_file = "/tmp/qga_test"
Windows:
get_log_cmd = type c:\qga.log |findstr /c:"read data"
get_log_cmd = type c:\qga.log |findstr /c:"%s"
tmp_file = "C:\qga_test.txt"
- gagent_query_chardev:
no isa_serial
Expand Down Expand Up @@ -615,13 +616,12 @@
- isa_serial:
# isa-serial is only supported on x86
only i386, x86_64
gagent_serial_type = isa
check_vioser = no
serials += " org.qemu.guest_agent.0"
gagent_start_cmd = "pgrep qemu-ga || qemu-ga -d -m isa-serial -p /dev/ttyS1 -l /var/log/qemu-ga/qemu-ga.log -v"
gagent_start_cmd = "pgrep qemu-ga || qemu-ga -d -m isa-serial -p /dev/ttyS1 -l /var/log/qemu-ga/qemu-ga.log"
gagent_status_cmd = "pgrep qemu-ga"
gagent_restart_cmd = "pgrep qemu-ga |xargs kill -s 9 && ${gagent_start_cmd}"
Windows:
gagent_start_cmd = "cd C:\Program Files\Qemu-ga & start /b qemu-ga.exe -m isa-serial -p COM2 -l c:\qga.log -v"
gagent_start_cmd = "cd C:\Program Files\Qemu-ga & start /b qemu-ga.exe -m isa-serial -p COM2 -l c:\qga.log"
gagent_status_cmd = "tasklist |findstr /i /r qemu-ga.exe.*Console"
gagent_restart_cmd = "taskkill /f /t /im qemu-ga.exe & ${gagent_start_cmd}"
6 changes: 3 additions & 3 deletions qemu/tests/live_backup_add_bitmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def check_bitmap_existence_as_expected(bitmaps, existence_param):
error_context.context("check bitmap existence", test.log.info)
check_bitmap_existence_as_expected(bitmaps, "existence")

error_context.context("system powerdown", test.log.info)
vm.monitor.system_powerdown()
if not vm.wait_for_shutdown(int(params.get("shutdown_timeout", 360))):
error_context.context("Shutting down the guest", test.log.info)
vm.graceful_shutdown(params.get_numeric("shutdown_timeout", 360))
if not vm.wait_for_shutdown():
test.fail("guest refuses to go down")

error_context.context("start vm", test.log.info)
Expand Down
7 changes: 3 additions & 4 deletions qemu/tests/qemu_guest_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3150,13 +3150,12 @@ def log_check(qga_cmd):
"""
error_context.context("Check %s cmd in agent log." % qga_cmd,
LOG_JOB.info)
log_str = session.cmd_output(get_log_cmd).strip().split('\n')[-1]
pattern = r"%s" % qga_cmd
if not re.findall(pattern, log_str, re.M | re.I):
get_log_cmd = params["get_log_cmd"] % qga_cmd
status, log_str = session.cmd_status_output(get_log_cmd).strip().split('\n')[-1]
if status or not log_str:
test.fail("The %s command is not recorded in agent"
" log." % qga_cmd)

get_log_cmd = params["get_log_cmd"]
session = self._get_session(self.params, self.vm)
self._open_session_list.append(session)
self._change_bl(session)
Expand Down