Skip to content

Commit

Permalink
[202405] [tacacs] increase timeout value for accounting test and igno…
Browse files Browse the repository at this point in the history
…re loganalyzer (#15857)

* resolve conflict

Signed-off-by: Mai Bui <[email protected]>
  • Loading branch information
maipbui authored Dec 4, 2024
1 parent e46f6ec commit f8f5bba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,6 @@ r, ".* WARNING kernel:.*pcieport.*device.*error.*status/mask=.*"
# SAI implement missing for the https://github.com/sonic-net/sonic-buildimage/pull/18912 caused the err msg pop up, need to ignore the err msgs before it SAI implement is done.
r, ".* ERR swss#orchagent:.*doAppSwitchTableTask.*Unsupported Attribute ecmp_hash_offset.*"
r, ".* ERR swss#orchagent:.*doAppSwitchTableTask.*Unsupported Attribute lag_hash_offset.*"

# Ignore auditd error
r, ".* ERR auditd\[\d*\]: Error receiving audit netlink packet \(No buffer space available\)"
10 changes: 5 additions & 5 deletions tests/tacacs/test_accounting.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def flush_log(host, log_file):
host_run_command(host, "sync {0}".format(log_file))


def wait_for_log(host, log_file, pattern, timeout=20, check_interval=1):
def wait_for_log(host, log_file, pattern, timeout=80, check_interval=1):
wait_time = 0
while wait_time <= timeout:
flush_log(host, log_file)
Expand Down Expand Up @@ -90,11 +90,11 @@ def check_tacacs_server_log_exist(ptfhost, tacacs_creds, command):
def check_tacacs_server_no_other_user_log(ptfhost, tacacs_creds):
username = tacacs_creds['tacacs_rw_user']
"""
Find logs not run by tacacs_rw_user from tac_plus.acct:
Remove all tacacs_rw_user's log with /D command.
Print logs not removed by /D command, which are not run by tacacs_rw_user.
Find logs not run by tacacs_rw_user & admin from tac_plus.acct:
Remove all tacacs_rw_user's and admin's log with /D command.
Print logs not removed by /D command, which are not run by tacacs_rw_user and admin.
"""
log_pattern = "/ {0} /D;/.*/P".format(username)
log_pattern = "/ {0} /D;/ {1} /D;/.*/P".format(username, "admin")
logs = wait_for_log(ptfhost, "/var/log/tac_plus.acct", log_pattern)
pytest_assert(len(logs) == 0, "Expected to find no accounting logs but found: {}".format(logs))

Expand Down

0 comments on commit f8f5bba

Please sign in to comment.