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

Add new tests for Link Local SIP/DIP

Open SavchukRomanLv opened this issue 1 year ago • 3 comments

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

SavchukRomanLv avatar Aug 07 '24 14:08 SavchukRomanLv

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:

  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 Aug 07 '24 15:08 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.................................................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:

  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 Aug 07 '24 16:08 mssonicbld

@bingwang-ms can you assign engineer to review

SavchukRomanLv avatar Oct 09 '24 13:10 SavchukRomanLv

@bingwang-ms @yxieca kindly reminder to assign a reviewer

liat-grozovik avatar Dec 18 '24 10:12 liat-grozovik

@prsunny, @kperumalbfn Could you please help review?

bingwang-ms avatar Dec 18 '24 17:12 bingwang-ms

Hi @prsunny , @kperumalbfn please approve

SavchukRomanLv avatar Jan 02 '25 12:01 SavchukRomanLv

Hi @prsunny , @kperumalbfn A kindly reminder.

bingwang-ms avatar Apr 16 '25 17:04 bingwang-ms

The test should first go to master and then cherry-pick based on branch approvers. I see the master PR is closed.

prsunny avatar Apr 18 '25 21:04 prsunny

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?

illia-kotvitskyi avatar Jun 10 '25 13:06 illia-kotvitskyi