Skip to content

Enhance PFC watchdog log analyzer to check debug information on a per-vendor basis#10305

Merged
bingwang-ms merged 2 commits intosonic-net:masterfrom
stephenxs:github-enhance-pfcwd-diagnosis
Oct 30, 2023
Merged

Enhance PFC watchdog log analyzer to check debug information on a per-vendor basis#10305
bingwang-ms merged 2 commits intosonic-net:masterfrom
stephenxs:github-enhance-pfcwd-diagnosis

Conversation

@stephenxs
Copy link
Contributor

@stephenxs stephenxs commented Oct 12, 2023

Description of PR

Summary:
Enhance PFC watchdog diagnosis information checking.

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

Recently, more diagnosis information has been introduced when PFC watchdog is triggered for some vendors.
This is to verify whether the diagnosis information is reported in the syslog.

How did you do it?

  1. Check diagnosis information in PFC watchdog detection message on a per-vendor basis
  2. Move the expected log message pattern to a common file
  3. In warm reboot scenario, the PFC watchdog can be reported based on APPL_DB content instead of counters. In this case, no additional information can be provided. So, do not check diagnosis information in this case.
  4. Do not check it on the branches that it is not supported, like 202211.

How did you verify/test it?

Run regression test PFC watchdog

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@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/pfcwd/files/pfcwd_helper.py:14:43: W605 invalid escape sequence '|'
tests/pfcwd/files/pfcwd_helper.py:14:59: W605 invalid escape sequence '|'
tests/pfcwd/files/pfcwd_helper.py:14:80: W605 invalid escape sequence '|'
tests/pfcwd/files/pfcwd_helper.py:14:103: W605 invalid escape sequence '|'
tests/pfcwd/files/pfcwd_helper.py:15:36: W605 invalid escape sequence '|'
tests/pfcwd/files/pfcwd_helper.py:15:57: W605 invalid escape sequence '|'
tests/pfcwd/files/pfcwd_helper.py:15:83: W605 invalid escape sequence '|'
tests/pfcwd/files/pfcwd_helper.py:15:101: W605 invalid escape sequence '.'
tests/pfcwd/files/pfcwd_helper.py:15:109: W605 invalid escape sequence '|'
tests/pfcwd/files/pfcwd_helper.py:16:31: W605 invalid escape sequence '.'
tests/pfcwd/files/pfcwd_helper.py:16:39: W605 invalid escape sequence '|'
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

@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/pfcwd/files/pfcwd_helper.py:15:101: W605 invalid escape sequence '.'
tests/pfcwd/files/pfcwd_helper.py:16:31: W605 invalid escape sequence '.'
tests/pfcwd/files/pfcwd_helper.py:20:1: E302 expected 2 blank lines, found 1

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>

@stephenxs stephenxs force-pushed the github-enhance-pfcwd-diagnosis branch from 8e5623a to a31d302 Compare October 12, 2023 05:45
@stephenxs stephenxs changed the title Enhance PFC watchdog debug information checking Enhance PFC watchdog log analyzer to check debug information on a per-vendor basis Oct 12, 2023
1. Check diagnosis information in PFC watchdog detection message on a per-vendor basis
2. Move expected log message to a common file

Change-Id: Ic6cb53d989fa49ed56f614553ce6d9f2ac5b8eda
Signed-off-by: Stephen Sun <[email protected]>
@stephenxs stephenxs force-pushed the github-enhance-pfcwd-diagnosis branch from a31d302 to 4b36c0d Compare October 12, 2023 09:03
@stephenxs stephenxs marked this pull request as ready for review October 12, 2023 15:02
Signed-off-by: Stephen Sun <[email protected]>
Change-Id: I4ee12dfa32247a89b725bb1e7df68727acf25413
@stephenxs stephenxs requested a review from neethajohn October 18, 2023 02:28
@bingwang-ms bingwang-ms merged commit a75a054 into sonic-net:master Oct 30, 2023
@stephenxs stephenxs deleted the github-enhance-pfcwd-diagnosis branch October 30, 2023 23:10
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Nov 2, 2023
…-vendor basis (sonic-net#10305)

* Enhance PFC watchdog debug information checking

1. Check diagnosis information in PFC watchdog detection message on a per-vendor basis
2. Move expected log message to a common file
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #10599

mssonicbld pushed a commit that referenced this pull request Nov 2, 2023
…-vendor basis (#10305)

* Enhance PFC watchdog debug information checking

1. Check diagnosis information in PFC watchdog detection message on a per-vendor basis
2. Move expected log message to a common file
bingwang-ms added a commit that referenced this pull request Nov 8, 2023
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.

5 participants