Skip to content

Ignore ansible log message when check TACACS accounting syslog.#12146

Merged
qiluo-msft merged 2 commits intosonic-net:masterfrom
liuh-80:dev/liuh/improve_account_ut
Apr 4, 2024
Merged

Ignore ansible log message when check TACACS accounting syslog.#12146
qiluo-msft merged 2 commits intosonic-net:masterfrom
liuh-80:dev/liuh/improve_account_ut

Conversation

@liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Mar 25, 2024

Ignore ansible log message when check TACACS accounting syslog.

Why I did it

Every ansible command will generate a syslog, when check TACACS accounting with sed command, the sed query will match the ansible log, this will make test case can't find regression.

Work item tracking
  • Microsoft ADO: 25270078

How I did it

Ignore ansible log message when check TACACS accounting syslog.

How to verify it

Pass all test case.
Fix TACACS accounting test case to prevent regression.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

will updated with this PR image later.

  • [] SONiC.master-16482.360728-2c8b4066f

Description for the changelog

Ignore ansible log message when check TACACS accounting syslog.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/tacacs/test_accounting.py:98:121: E501 line too long (121 > 120 characters)
tests/tacacs/test_accounting.py:127:121: E501 line too long (144 > 120 characters)

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@liuh-80 liuh-80 requested a review from qiluo-msft March 26, 2024 01:30
@liuh-80 liuh-80 marked this pull request as ready for review March 26, 2024 01:30
@qiluo-msft qiluo-msft merged commit 52af021 into sonic-net:master Apr 4, 2024
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jul 12, 2024
…c-net#12146)

Ignore ansible log message when check TACACS accounting syslog.

#### Why I did it
Every ansible command will generate a syslog, when check TACACS accounting with sed command, the sed query will match the ansible log, this will make test case can't find regression. 

### How I did it
Ignore ansible log message when check TACACS accounting syslog.

#### How to verify it
Pass all test case.
Fix TACACS accounting test case to prevent regression.

### Tested branch (Please provide the tested image version)

will updated with this PR image later.
- [] SONiC.master-16482.360728-2c8b4066f

#### Description for the changelog
Ignore ansible log message when check TACACS accounting syslog.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #13643

mssonicbld pushed a commit that referenced this pull request Jul 12, 2024
Ignore ansible log message when check TACACS accounting syslog.

#### Why I did it
Every ansible command will generate a syslog, when check TACACS accounting with sed command, the sed query will match the ansible log, this will make test case can't find regression. 

### How I did it
Ignore ansible log message when check TACACS accounting syslog.

#### How to verify it
Pass all test case.
Fix TACACS accounting test case to prevent regression.

### Tested branch (Please provide the tested image version)

will updated with this PR image later.
- [] SONiC.master-16482.360728-2c8b4066f

#### Description for the changelog
Ignore ansible log message when check TACACS accounting syslog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants