Skip to content

Commit

Permalink
Update test_ro_disk.py (#14150)
Browse files Browse the repository at this point in the history
Improve test_ro_disk logrotate failed because auth.log missing issue.

#### Why I did it
test case  test_ro_disk failed because following error:
error: stat of /var/log/syslog failed: Bad message
du: cannot access '/var/log/auth.log': Bad message

### How I did it
Improve test_ro_disk logrotate failed because auth.log missing issue.

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

### Description for the changelog
Improve test_ro_disk logrotate failed because auth.log missing issue.
  • Loading branch information
liuh-80 authored and mssonicbld committed Aug 29, 2024
1 parent 7f07449 commit d4ab405
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/tacacs/test_ro_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ def log_rotate(duthost):
if "logrotate does not support parallel execution on the same set of logfiles" in e.message:
# command will failed when log already in rotating
logger.warning("logrotate command failed: {}".format(e))
elif "error: stat of /var/log/auth.log failed: Bad message" in e.message:
# command will failed because auth.log missing
logger.warning("logrotate command failed: {}".format(e))
elif "du: cannot access '/var/log/auth.log': Bad message" in e.message:
# command will failed because auth.log missing
logger.warning("logrotate command failed: {}".format(e))
else:
raise e

Expand Down

0 comments on commit d4ab405

Please sign in to comment.