sonic-mgmt
sonic-mgmt copied to clipboard
[T0/T1/T2]: New ECMP Hashing test upon member flap trigger
Description of PR
Summary: Covers following
- TestGap on VOQ Chassis: https://github.com/sonic-net/sonic-mgmt/issues/14985
- Generic all platform ECMP Hashing test with Member flap trigger
Type of change
- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [x] Test case(new/improvement)
Back port request
- [ ] 202012
- [ ] 202205
- [x] 202305
- [x] 202311
- [x] 202405
Approach
What is the motivation for this PR?
Currently there is no test case to cover ECMP hashing upon member flap trigger. This gap is present on pizza box DUTs as well. Also on VOQ chassis the ECMP member flap on one linecard, needs to get synced to remote linecards. We currently dont have testcase covering this.
How did you do it?
Wrote a new testcase test_ecmp_group_member_flap(common for all topology types). Underlying it utilizes the existing fib_test infrastructure.
High level: Here, I am verifying ECMP member flap test on default route. The test will be skipped if DUT doesnt have default route/num paths <2. Initially the test verifies traffic forwarding and ECMP hashing of this default route. Then one of the member port is brought down, and the again traffic test and ECMP hashing test is carried out. Finally, the member port is brought back and traffic/hash test is carried out.
For VOQ chassis, I pass an additional parameter(skip_src_ports) to ensure that ptf incoming traffic lands on remote linecard. This is to ensure ECMP member down/up is handled on remote linecards properly.
How did you verify/test it?
Verified the test on T2 Chassis. Also verified on T1 DUT.
Any platform specific information?
None
Supported testbed topology if it's a new test case?
All
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.........................................................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/common/fixtures/fib_utils.py:39:35: W605 invalid escape sequence '.'
tests/common/fixtures/fib_utils.py:39:38: W605 invalid escape sequence '.'
tests/common/fixtures/fib_utils.py:39:41: W605 invalid escape sequence '.'
tests/fib/test_fib.py:55:1: E302 expected 2 blank lines, found 1
tests/fib/test_fib.py:96:1: E302 expected 2 blank lines, found 1
tests/fib/test_fib.py:119:1: E302 expected 2 blank lines, found 1
tests/fib/test_fib.py:140:1: E302 expected 2 blank lines, found 1
tests/fib/test_fib.py:166:1: E303 too many blank lines (3)
tests/fib/test_fib.py:245:121: E501 line too long (128 > 120 characters)
tests/fib/test_fib.py:480:121: E501 line too long (128 > 120 characters)
tests/fib/test_fib.py:534:121: E501 line too long (128 > 120 characters)
...
[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:
- 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>
@arlakshm could you help review this? Thanks!
@deepak-singhal0408, can you resolve the comments
@deepak-singhal0408, can you resolve the comments
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
@arlakshm resolved merge conflicts.. could you help reapprove/merge? Thanks!
Hello, Can you explain why you removed the function fib_info_files_per_function for this PR? It was in use for other test cases, is there a replacement?
Hello, Can you explain why you removed the function fib_info_files_per_function for this PR? It was in use for other test cases, is there a replacement?
@Azarack the function is not removed.. its just moved from fixture to regular function.. its available in test_fib.py...