Skip to content

Fix to use non RegionalHub T3 peers when selecting port. #9023

Merged
judyjoseph merged 3 commits intosonic-net:masterfrom
judyjoseph:voq_fix_ping_failures
Jul 25, 2023
Merged

Fix to use non RegionalHub T3 peers when selecting port. #9023
judyjoseph merged 3 commits intosonic-net:masterfrom
judyjoseph:voq_fix_ping_failures

Conversation

@judyjoseph
Copy link
Contributor

Description of PR

When the minigraph/Config has T3 Peer is a "Regional Hub" type in DEVICE_NEIGHBOR_METADATA and if we select that T3 peer loopback IP for end to end ping -- the ping from T1 --> T3 loopback ip fails. This is because the the routemaps for that "Regional Hub" type filter the loopback routes advertised to SONiC T2.

Summary:
Fixes #9021

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

How did you do it?

Fix was to use T3 peer devices of this SONiC T2 which is of other types like AZNGHub. So filter the ethernet/portchannel interfaces based on which peer type it is connected to.

How did you verify/test it?

Ran the above tests which were failing earlier and it passes now.

collected 20 items                                                                                                                                                                                                                      

voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[ethernet-4-portA-my_ip] PASSED                                                                                                                                              [  5%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[ethernet-4-portA-my_lb_ip] PASSED                                                                                                                                           [ 10%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[ethernet-4-portA-inband] PASSED                                                                                                                                             [ 15%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[ethernet-4-portD-my_lb_ip] PASSED                                                                                                                                           [ 20%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[ethernet-4-portD-inband] PASSED                                                                                                                                             [ 25%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[ethernet-6-portA-my_ip] PASSED                                                                                                                                              [ 30%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[ethernet-6-portA-my_lb_ip] PASSED                                                                                                                                           [ 35%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[ethernet-6-portA-inband] PASSED                                                                                                                                             [ 40%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[ethernet-6-portD-my_lb_ip] PASSED                                                                                                                                           [ 45%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[ethernet-6-portD-inband] PASSED                                                                                                                                             [ 50%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[portchannel-4-portA-my_ip] PASSED                                                                                                                                           [ 55%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[portchannel-4-portA-my_lb_ip] PASSED                                                                                                                                        [ 60%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[portchannel-4-portA-inband] PASSED                                                                                                                                          [ 65%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[portchannel-4-portD-my_lb_ip] PASSED                                                                                                                                        [ 70%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[portchannel-4-portD-inband] PASSED                                                                                                                                          [ 75%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[portchannel-6-portA-my_ip] PASSED                                                                                                                                           [ 80%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[portchannel-6-portA-my_lb_ip] PASSED                                                                                                                                        [ 85%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[portchannel-6-portA-inband] PASSED                                                                                                                                          [ 90%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[portchannel-6-portD-my_lb_ip] PASSED                                                                                                                                        [ 95%]
voq/test_voq_ipfwd.py::test_ipforwarding_jumbo_to_dut[portchannel-6-portD-inband] PASSED                                                                                                                                          [100%]

------------------------------------------------------------------------------------- generated xml file: /var/src/sonic-mgmt-int/tests/logs/tr.xml -------------------------------------------------------------------------------------
====================================================================================================== 20 passed in 618.00 seconds ======================================================================================================

Any platform specific information?

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

Documentation

… type has roupemaps which

filters route resulting in test failures.
@mssonicbld
Copy link
Collaborator

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/voq/test_voq_ipfwd.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/voq/test_voq_ipfwd.py:291:32: E222 multiple spaces after operator
tests/voq/test_voq_ipfwd.py:292:41: E222 multiple spaces after operator
tests/voq/test_voq_ipfwd.py:292:121: E501 line too long (130 > 120 characters)
tests/voq/test_voq_ipfwd.py:298:13: E265 block comment should start with '# '
tests/voq/test_voq_ipfwd.py:299:121: E501 line too long (136 > 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:

  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
Copy link
Collaborator

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/voq/test_voq_ipfwd.py

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/voq/test_voq_ipfwd.py: failed parsing with CPython 3.8.10:

Traceback (most recent call last):
File "/home/AzDevOps/.cache/pre-commit/repoxy5omko8/py_env-python3/lib/python3.8/site-packages/pre_commit_hooks/check_ast.py", line 21, in main
ast.parse(f.read(), filename=filename)
File "/usr/lib/python3.8/ast.py", line 47, in parse
...
[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>

@judyjoseph judyjoseph force-pushed the voq_fix_ping_failures branch from 5bcdc1d to 7594bd5 Compare July 19, 2023 18:37
@mssonicbld
Copy link
Collaborator

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/voq/test_voq_ipfwd.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/voq/test_voq_ipfwd.py:300:35: E127 continuation line over-indented for visual indent

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>

@jarias-lfx
Copy link

/easycla

@judyjoseph judyjoseph requested a review from arlakshm July 20, 2023 02:34
Copy link
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@judyjoseph judyjoseph merged commit 5f808bf into sonic-net:master Jul 25, 2023
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jul 27, 2023
)

* Fix to use non RegionalHub T3 peers when selecting port. Regional hub type has roupemaps which
filters route resulting in test failures.
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202205: #9138

mssonicbld pushed a commit that referenced this pull request Jul 27, 2023
* Fix to use non RegionalHub T3 peers when selecting port. Regional hub type has roupemaps which
filters route resulting in test failures.
@mssonicbld
Copy link
Collaborator

@judyjoseph PR conflicts with 202305 branch

@mssonicbld
Copy link
Collaborator

@judyjoseph PR conflicts with 202205 branch

@wangxin
Copy link
Collaborator

wangxin commented Aug 28, 2023

This PR was merged before 202305 branch was created. Removing 202305 related labels.

@wangxin
Copy link
Collaborator

wangxin commented Aug 28, 2023

@judyjoseph PR conflicts with 202305 branch

Already included in 202305 branch.

@wangxin
Copy link
Collaborator

wangxin commented Aug 28, 2023

@judyjoseph PR conflicts with 202205 branch

Already cherry-picked to 202205 branch.

AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Jan 25, 2024
)

* Fix to use non RegionalHub T3 peers when selecting port. Regional hub type has roupemaps which
filters route resulting in test failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Voq chassis end to end Ping tests fail

5 participants