You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def change_and_wait_aaa_config_update(duthost, command, last_timestamp=None, timeout=10):
if not last_timestamp:
last_timestamp = get_auditd_config_reload_timestamp(duthost)
duthost.shell(command)
# After AAA config update, hostcfgd will modify config file and notify auditd reload config
# Wait auditd reload config finish
def log_exist(duthost):
latest_timestamp = get_auditd_config_reload_timestamp(duthost)
return latest_timestamp != last_timestamp
exist = wait_until(timeout, 1, 0, log_exist, duthost)
> pytest_assert(exist, "Not found aaa config update log: {}".format(command))
E Failed: Not found aaa config update log: sudo config aaa authorization tacacs+
The test grabs the last instance of the log returned by sudo journalctl -u auditd --boot --no-pager | grep 'audisp-tacplus re-initializing configuration'
Then enables sudo config aaa authorization tacacs+
And confirms there is a newer instance of the audisp-tacplus re-initializing configuration log.
However, the issue is it checks for this newer instance based on the timestamp, but the timestamp is at a per-second granularity.
So if the new log is within the same second the test will fail.
Note that there is a new entry but because it has the same timestamp Jan 29 00:26:56 as the previous entry the test will hit a string match and cause the test to fail:
Issue Description
The test grabs the last instance of the log returned by
sudo journalctl -u auditd --boot --no-pager | grep 'audisp-tacplus re-initializing configuration'
Then enables
sudo config aaa authorization tacacs+
And confirms there is a newer instance of the
audisp-tacplus re-initializing configuration
log.However, the issue is it checks for this newer instance based on the timestamp, but the timestamp is at a per-second granularity.
So if the new log is within the same second the test will fail.
E.G. from our output:
Note that there is a new entry but because it has the same timestamp
Jan 29 00:26:56
as the previous entry the test will hit a string match and cause the test to fail:Results you see
Test failing when back to back logs are within the same second.
Results you expected to see
Test should pass if it sees a new log, we shouldn't rely on the timestamp.
Is it platform specific
generic
Relevant log output
Output of
show version
Attach files (if any)
No response
The text was updated successfully, but these errors were encountered: