sonic-mgmt
sonic-mgmt copied to clipboard
[Mellanox] Fix test_shared_headroom_pool_configure issue
Description of PR
For mellanox device, the headroom size is related to the speed and cable length. In community setup, some cable length is 300m in config, so when the speed is over 400G, the headroom size will exceed the limitation. So for test_shared_headroom_pool_configure, we change the cable length to a smaller when speed is equal or greater 400G and the cable length is over 200m.
Summary: Fixes # (issue)
Type of change
- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] Test case(new/improvement)
Back port request
- [ ] 201911
- [ ] 202012
- [ ] 202205
- [ ] 202305
- [x] 202311
Approach
What is the motivation for this PR?
Fix test_shared_headroom_pool_configure issue
How did you do it?
Change the cable length to a smaller one such as 50, when the cable length to a smaller when speed is equal or greater 400G and the cable length is over 200m.
How did you verify/test it?
Run test_shared_headroom_pool_configure on setup which has ports with speed over 400G and cable length over 300m
Any platform specific information?
Mellanox
Supported testbed topology if it's a new test case?
Any
Documentation
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.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing tests/qos/files/mellanox/ports_cable_len.j2
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/qos/buffer_helpers.py:76:99: E202 whitespace before ')'
tests/qos/test_buffer.py:20:1: F401 'tests.qos.buffer_helpers.update_cable_len_for_all_ports' imported but unused
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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
/azpw run Azure.sonic-mgmt
/AzurePipelines run Azure.sonic-mgmt
Azure Pipelines successfully started running 1 pipeline(s).
@kperumalbfn Can you please help review?
Hi @JibinBao, can you please remind me what's the error if the headroom size will exceed the limitation?
Hi @JibinBao, can you please remind me what's the error if the headroom size will exceed the limitation?
Hi @bingwang-ms , The error is like below: Failed: Pool size isn't correct in database: expected pool 34922496.0 shp 0, size in APPL_DB pool 45785088 shp 655360, size in ASIC_DB ('45785088', '655360')
@kperumalbfn Can you help review?
hi @kperumalbfn , Can you help review it again?
@kperumalbfn any further comment or you can sing off?
@kperumalbfn Kindly reminder.
Cherry-pick PR to 202411: https://github.com/sonic-net/sonic-mgmt/pull/17330