sonic-mgmt
sonic-mgmt copied to clipboard
Add new tests for Link Local SIP/DIP
Description of PR
Summary: Update PR # (https://github.com/sonic-net/sonic-mgmt/pull/11940), as FO changed this test will be covered by @SavchukRomanLv
Type of change
- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [x] Test case(new/improvement)
Back port request
- [ ] 202012
- [ ] 202205
- [ ] 202305
- [x] 202311
- [x] 202405
Approach
What is the motivation for this PR?
To verify that MSFT hwsku will allow packets with link-local source/destination IP to be forwarded by the dut. This capability is only supported on systems that have SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 in sai.profile
How did you do it?
Revised the existing IP test and used common functionality, also reviewed the test plan, and implemented tests accordingly.
How did you verify/test it?
run it on all topologies to check the stability
Any platform specific information?
systems that have SAI_NOT_DROP_SIP_DIP_LINK_LOCAL=1 in sai.profile
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.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Failed
- hook id: check-ast
- exit code: 1
tests/ip/link_local/test_link_local_ip.py: failed parsing with CPython 3.10.12:
Traceback (most recent call last):
File "/home/AzDevOps/.cache/pre-commit/repo2fn9f097/py_env-python3/lib/python3.10/site-packages/pre_commit_hooks/check_ast.py", line 21, in main
ast.parse(f.read(), filename=filename)
File "/usr/lib/python3.10/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "tests/ip/link_local/test_link_local_ip.py", line 85
pytest.skip(f"Test case not supported at {tbinfo["topo"]["name"]} topology")
^^^^
SyntaxError: f-string: unmatched '['
...
[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>
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/ip/link_local/test_link_local_ip.py:122:121: E501 line too long (139 > 120 characters)
tests/ip/link_local/test_link_local_ip.py:123:121: E501 line too long (121 > 120 characters)
tests/ip/link_local/test_link_local_ip.py:128:121: E501 line too long (122 > 120 characters)
tests/ip/link_local/test_link_local_ip.py:131:121: E501 line too long (122 > 120 characters)
tests/ip/link_local/test_link_local_ip.py:178:121: E501 line too long (127 > 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:
- 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>
@bingwang-ms can you assign engineer to review
@bingwang-ms @yxieca kindly reminder to assign a reviewer
@prsunny, @kperumalbfn Could you please help review?
Hi @prsunny , @kperumalbfn please approve
Hi @prsunny , @kperumalbfn A kindly reminder.
The test should first go to master and then cherry-pick based on branch approvers. I see the master PR is closed.
Created a separate PR with the master target branch: https://github.com/sonic-net/sonic-mgmt/pull/18906 @nhe-NV, do you know if we can close this PR without the author?