Skip to content

Commit

Permalink
Merge pull request autotest#5684 from chunfuwen/fix_check_auvirt_log_…
Browse files Browse the repository at this point in the history
…failure

Fix virsh.start.status_error_no.audit_log_search failure in checking …
  • Loading branch information
dzhengfy committed Jun 13, 2024
2 parents 9a38d7f + 461a34a commit 155b7e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libvirt/tests/src/virsh_cmd/domain/virsh_start.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import logging as log

from avocado.utils import process
Expand Down Expand Up @@ -54,6 +55,9 @@ def check_auvirt_log(test, params):
vm_name = params.get("main_vm", "avocado-vt-vm1")
str_to_grep = params.get("auvirt_error_msg") % vm_name
auvirt_log_file = params.get("tmp_auvirt_event_log")
if os.path.exists(auvirt_log_file):
cmd = f"truncate -s 0 {auvirt_log_file}"
process.run(cmd, ignore_status=True, shell=True, verbose=True)
generate_virt_log_cmd = "auvirt --start recent --all-events|tee %s" % auvirt_log_file
process.run(generate_virt_log_cmd, ignore_status=False, shell=True, verbose=True)
if not libvirt.check_logfile(str_to_grep, auvirt_log_file, str_in_log=False):
Expand Down

0 comments on commit 155b7e8

Please sign in to comment.