Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use number of logs instead of timestamp in change_and_wait_aaa_config_update #16723

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

arista-nwolfe
Copy link
Contributor

change_and_wait_aaa_config_update validates that the auditd service publishes the log audisp-tacplus re-initializing configuration after executing the passed in command.

However, it did this by checking that the timestamp in the log message was different than the previously emitted log.
As shown in #16709 these message can appear within the same second and cause the test to fail.

Instead this PR changes the approach to look at how many logs have been emitted before and after the command rather than the timestamp changes.

Summary:
Fixes #16709

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@arista-nwolfe
Copy link
Contributor Author

@wenyiz2021

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)
def change_and_wait_aaa_config_update(duthost, command, last_line_count=None, timeout=10):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just did a quick search and it shows besides test_accounting,py, there is test_ro_disk.py and test_authorization.py that call this function, please change accordingly.

@arista-nwolfe
Copy link
Contributor Author

Thanks for looking @wenyiz2021 I only changed the last_timestamp keyword argument in the function signature.
test_ro_disk.py and test_authorization.py don't pass that keyword argument so they don't need updating

@wenyiz2021 wenyiz2021 self-assigned this Feb 3, 2025
@rlhui rlhui merged commit 323ed51 into sonic-net:master Feb 6, 2025
13 checks passed
arista-nwolfe added a commit to arista-nwolfe/sonic-mgmt.msft that referenced this pull request Feb 10, 2025
Use number of logs instead of timestamp in
change_and_wait_aaa_config_update
sonic-net/sonic-mgmt#16723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment