Skip to content

Commit

Permalink
qemu_guest_agent: adjust check method for isa-serial situation
Browse files Browse the repository at this point in the history
since there is a minor change for starting qemu-ga.exe, it will
display debug info about version of mingw-qemu-ga so that auto
program couldn't catch the expected condition to determine cmd
run finished. so remove invaluable parameter '-v' after confirm
with dev.

Signed-off-by: demeng <[email protected]>
  • Loading branch information
6-dehan committed Aug 7, 2023
1 parent 62ad78f commit 1e03fcc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
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 @@ -614,13 +615,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}"
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

0 comments on commit 1e03fcc

Please sign in to comment.