Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chassis] [MA] Route flap fix #10206

Merged
merged 8 commits into from
Oct 31, 2023
Merged

Conversation

wenyiz2021
Copy link
Contributor

@wenyiz2021 wenyiz2021 commented Oct 2, 2023

Description of PR

Fix issue for packet chassis.
For VOQ chassis or other multi-asic duts, we were using VOQ_INBAND_INTERFACE and BGP_INTERNAL_NEIGHBOR to exclude internal interfaces in this test. However, packet chassis internal interfaces/portchannels do not have any IP associated with them.
Changes in this PR:

  1. not use BGP_INTERNAL_NEIGHBOR, use PORTCHANNEL_MEMBER for MA dut and packet chassis, to get internal interfaces.
  2. voq chassis continue to use VOQ_INBAND_INTERFACE
  3. remove the check for single-asic devices, they don't have internal links, no need to check.
  4. after filtering out internal links, confirm the dev_port we get is external port again by using show ip int and grep for this dev_port, show ip int without -d all will not have internal links. Ideally the dev_port should already be an external link, but if there is any multi-asic device that does not have point#1 and point#2 above, this check will get hit and we skip applying this port to dev_port.
    Note that by using grep -w we will be doing complete word match.
e.g. 
admin@masic-lc:~$ show ip int | grep -w PortChannel102
PortChannel102             xxx/31          up/up         xxxT3      10.0.0.1
admin@masic-lc:~$ show ip int | grep -w PortChannel1
admin@masic-lc:~$

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

verified on one linecard of packet chassis.

Any platform specific information?

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

Documentation

@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.................................................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/route/test_route_flap.py:269:48: F821 undefined name 'voq_inband_interfaces'

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>

@wenyiz2021 wenyiz2021 requested review from SuvarnaMeenakshi and abdosi and removed request for jcaiMR October 2, 2023 19:12
@wenyiz2021
Copy link
Contributor Author

hi @abdosi @SuvarnaMeenakshi can you help to review this PR?

@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/common/devices/multi_asic.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
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>

@wenyiz2021 wenyiz2021 changed the title [packet chassis] Route flap fix for packet chassis [chassis] Route flap fix for chassis Oct 26, 2023
@wenyiz2021 wenyiz2021 changed the title [chassis] Route flap fix for chassis [chassis] [MA] Route flap fix Oct 26, 2023
@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.................................................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/route/test_route_flap.py:271:37: F821 undefined name 'internal_bgp_ips'

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>

@wenyiz2021 wenyiz2021 merged commit 173afaf into sonic-net:master Oct 31, 2023
13 checks passed
@wenyiz2021 wenyiz2021 deleted the route_flap_fix branch October 31, 2023 23:43
@mssonicbld
Copy link
Collaborator

@wenyiz2021 PR conflicts with 202305 branch

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Nov 1, 2023
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202205: #10553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants