Skip to content

Commit

Permalink
Update test_ro_disk.py (sonic-net#12913)
Browse files Browse the repository at this point in the history
Fix ro disk test case generate garbled syslog and break loganalyzer issue.

#### Why I did it
Log rotate during ro disk may cause syslog file contains garbled characters.
These characters will break loganalyzer, to fix this issue, rotate again to cleanup syslog file.

#### How I did it
log rotate again after ro disk test case finish,

#### How to verify it
Pass all test case.

#### Description for the changelog
Fix ro disk test case generate garbled syslog and break loganalyzer issue.
  • Loading branch information
liuh-80 authored and parmarkj committed Jul 17, 2024
1 parent 5809429 commit d4b8826
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/tacacs/test_ro_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def test_ro_disk(localhost, ptfhost, duthosts, enum_rand_one_per_hwsku_hostname,
duthost.copy(src=conf_path, dest="/etc/rsyslog.d/000-ro_disk.conf")

# To get file in decent size. Force a rotate
<<<<<<< HEAD
<<<<<<< HEAD
log_rotate(duthost)
=======
Expand All @@ -203,6 +204,9 @@ def test_ro_disk(localhost, ptfhost, duthosts, enum_rand_one_per_hwsku_hostname,
else:
raise e
>>>>>>> [TACACS] Handle log rotate failed issue (#12821)
=======
log_rotate(duthost)
>>>>>>> Update test_ro_disk.py (#12913)

res = duthost.shell("systemctl restart rsyslog")
assert res["rc"] == 0, "failed to restart rsyslog"
Expand Down

0 comments on commit d4b8826

Please sign in to comment.