sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

ACL testcase fix for Cisco 8122 Platform

Open santoss3 opened this issue 1 year ago • 11 comments

Description of PR

ACL test fix for 8122, Added Platform check to skip the Byte Accounting. Summary: Fixes # (issue) ACL byte counters not supported in Cisco 8122 and test_acl.py tests (32 Testcases) fails due to assertion for byte counters.

Type of change

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

Back port request

  • [ ] 201911
  • [ ] 202012
  • [ ] 202205
  • [x] 202305
  • [x] 202311

Approach

What is the motivation for this PR?

Add Fix for failing testcase in test_acl.py.

How did you do it?

Added check to skip byte accounting for Cisco 8122 Platform

How did you verify/test it?

Verified that all the ACL testcases are passing for Cisco 8122 Platform

Any platform specific information?

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

Documentation

santoss3 avatar Feb 07 '24 23:02 santoss3

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.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/acl/test_acl.py

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/acl/test_acl.py:1186:21: E128 continuation line under-indented for visual indent
tests/acl/test_acl.py:1191:21: E128 continuation line under-indented for visual indent
tests/acl/test_acl.py:1225:21: E128 continuation line under-indented for visual indent
tests/acl/test_acl.py:1229:21: E128 continuation line under-indented for visual indent
...
[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 avatar Feb 07 '24 23:02 mssonicbld

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.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/acl/test_acl.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
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>

mssonicbld avatar Feb 08 '24 00:02 mssonicbld

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.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/acl/test_acl.py

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/acl/test_acl.py:768:21: E129 visually indented line with same indent as next logical line

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>

mssonicbld avatar Feb 08 '24 23:02 mssonicbld

@XuChen-MSFT @prgeor @prsunny : Requesting review

shivuv avatar Mar 07 '24 05:03 shivuv

@XuChen-MSFT @prgeor @prsunny : Please help with the PR review.

jamesan47 avatar Apr 10 '24 17:04 jamesan47