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

BGP suppress fib pending script #7430

Merged
merged 1 commit into from
Jun 2, 2023

Conversation

echuawu
Copy link
Contributor

@echuawu echuawu commented Feb 10, 2023

Add BGP suppress fib pending script
docs/testplan/BGP-Suppress-FIB-Pending-test-plan.md

Description of PR

Summary:
Add a new script to cover BGP suppress fib pending function test.

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?

This functionality provides feedback to FRR so that routes are not advertised until they are installed in the FIB. Support for bgp suppress-fib-pending s required in SONIC.

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

T1 topology testbed

nhe-NV
nhe-NV previously approved these changes Feb 10, 2023
@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame
author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

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/bgp/bgp_helpers.py:241:121: E501 line too long (124 > 120 characters)
tests/bgp/test_bgp_suppress_fib.py:317:121: E501 line too long (133 > 120 characters)

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 detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame
author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/bgp/test_bgp_suppress_fib.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/bgp/bgp_helpers.py:241:121: E501 line too long (124 > 120 characters)

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>

@echuawu echuawu force-pushed the bgp_suppress_fib_script branch 2 times, most recently from a3f4cd7 to 068c0e5 Compare March 27, 2023 04:53
@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame
author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/bgp/bgp_helpers.py
Fixing tests/bgp/test_bgp_suppress_fib.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

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>

@liat-grozovik
Copy link
Collaborator

@echuawu could you please handle conflicts?

@echuawu
Copy link
Contributor Author

echuawu commented May 11, 2023

@echuawu could you please handle conflicts?

Hi @liat-grozovik , done.

@echuawu
Copy link
Contributor Author

echuawu commented May 12, 2023

/azpw run Azure.sonic-mgmt

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-mgmt

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@echuawu
Copy link
Contributor Author

echuawu commented May 12, 2023

/azpw run Azure.sonic-mgmt

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-mgmt

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@StormLiangMS StormLiangMS requested a review from jcaiMR May 23, 2023 14:03
@StormLiangMS
Copy link
Collaborator

@jcaiMR could you take a look and comment?

bgp_neighbor_ipv6 = duthost.shell(cmd_v6.format(vm_name))['stdout'][1:-1]
logging.info("BGP neighbor of {} is {}".format(vm_name, bgp_neighbor_ip))
logging.info("IPv6 BGP neighbor of {} is {}".format(vm_name, bgp_neighbor_ipv6))

Copy link
Contributor

Choose a reason for hiding this comment

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

There is already a function to get bgp neighbor ips, something like:
bgp_facts = duthost.bgp_facts()['ansible_facts']
bgp_facts['bgp_neighbors']

Would this method can be use in your case ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @jcaiMR ,
Checked with this method, it could not list the bgp neighbors under user defined vrf:
(Pdb) duthost.bgp_facts()
Thursday 25 May 2023 12:56:05 +0300 (0:01:45.335) 0:24:46.708 **********
{u'invocation': {u'module_args': {u'instance_id': None, u'num_npus': 1}}, 'failed': False, 'changed': False, '_ansible_no_log': False, u'ansible_facts': {u'bgp_statistics': {u'ipv4_idle': 0, u'ipv6_idle': 0, u'ipv4_admin_down': 0, u'ipv6_admin_down': 0, u'ipv6': 0, u'ipv4': 0}, u'bgp_neighbors': {}}}

c-panther-01# show ip bgp vrf Vrf1 summary

IPv4 Unicast Summary (VRF Vrf1):
BGP router identifier 10.0.0.62, local AS number 65100 vrf-id 417
BGP table version 11346
RIB entries 12853, using 2310 KiB of memory
Peers 48, using 34 MiB of memory
Peer groups 2, using 128 bytes of memory

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc
10.0.0.1 4 65200 3262 78 0 0 0 00:03:38 6370 4 ARISTA01T2
10.0.0.5 4 65200 3262 79 0 0 0 00:03:38 6370 4 ARISTA03T2
10.0.0.9 4 65200 3262 79 0 0 0 00:03:39 6370 4 ARISTA05T2
10.0.0.13 4 65200 3262 78 0 0 0 00:03:37 6370 4 ARISTA07T2
10.0.0.17 4 65200 3262 78 0 0 0 00:03:38 6370 4 ARISTA09T2
10.0.0.21 4 65200 3262 81 0 0 0 00:03:37 6370 4 ARISTA11T2
10.0.0.25 4 65200 3262 78 0 0 0 00:03:38 6370 4 ARISTA13T2
10.0.0.29 4 65200 3262 78 0 0 0 00:03:38 6370 4 ARISTA15T2
10.0.0.33 4 64001 80 79 0 0 0 00:03:39 4 4 ARISTA01T0
10.0.0.35 4 64002 78 78 0 0 0 00:03:38 3 4 ARISTA02T0
10.0.0.37 4 64003 79 78 0 0 0 00:03:38 4 4 ARISTA03T0
10.0.0.39 4 64004 78 78 0 0 0 00:03:38 3 4 ARISTA04T0
10.0.0.41 4 64005 78 78 0 0 0 00:03:38 3 4 ARISTA05T0
10.0.0.43 4 64006 78 79 0 0 0 00:03:39 3 4 ARISTA06T0
10.0.0.45 4 64007 78 78 0 0 0 00:03:37 3 4 ARISTA07T0
10.0.0.47 4 64008 78 78 0 0 0 00:03:38 3 4 ARISTA08T0
10.0.0.49 4 64009 78 78 0 0 0 00:03:38 3 4 ARISTA09T0
10.0.0.51 4 64010 78 78 0 0 0 00:03:37 3 4 ARISTA10T0
10.0.0.53 4 64011 78 78 0 0 0 00:03:38 3 4 ARISTA11T0
10.0.0.55 4 64012 80 78 0 0 0 00:03:38 5 4 ARISTA12T0
10.0.0.57 4 64013 78 78 0 0 0 00:03:38 3 4 ARISTA13T0
10.0.0.59 4 64014 78 78 0 0 0 00:03:38 3 4 ARISTA14T0
10.0.0.61 4 64015 78 78 0 0 0 00:03:38 3 4 ARISTA15T0
10.0.0.63 4 64016 78 78 0 0 0 00:03:38 3 4 ARISTA16T0
fc00::2 4 65200 3260 129 0 0 0 00:03:30 NoNeg NoNeg ARISTA01T2
fc00::a 4 65200 3263 190 0 0 0 00:03:39 NoNeg NoNeg ARISTA03T2
fc00::12 4 65200 3260 129 0 0 0 00:03:30 NoNeg NoNeg ARISTA05T2
fc00::1a 4 65200 3260 129 0 0 0 00:03:31 NoNeg NoNeg ARISTA07T2
fc00::22 4 65200 3260 129 0 0 0 00:03:32 NoNeg NoNeg ARISTA09T2
fc00::2a 4 65200 3260 130 0 0 0 00:03:32 NoNeg NoNeg ARISTA11T2
fc00::32 4 65200 3260 129 0 0 0 00:03:31 NoNeg NoNeg ARISTA13T2
fc00::3a 4 65200 3262 189 0 0 0 00:03:38 NoNeg NoNeg ARISTA15T2
fc00::42 4 64001 75 123 0 0 0 00:03:28 NoNeg NoNeg ARISTA01T0
fc00::46 4 64002 76 129 0 0 0 00:03:30 NoNeg NoNeg ARISTA02T0
fc00::4a 4 64003 75 128 0 0 0 00:03:29 NoNeg NoNeg ARISTA03T0
fc00::4e 4 64004 75 128 0 0 0 00:03:29 NoNeg NoNeg ARISTA04T0
fc00::52 4 64005 75 128 0 0 0 00:03:29 NoNeg NoNeg ARISTA05T0
fc00::56 4 64006 75 123 0 0 0 00:03:28 NoNeg NoNeg ARISTA06T0
fc00::5a 4 64007 75 123 0 0 0 00:03:29 NoNeg NoNeg ARISTA07T0
fc00::5e 4 64008 75 128 0 0 0 00:03:29 NoNeg NoNeg ARISTA08T0
fc00::62 4 64009 76 129 0 0 0 00:03:30 NoNeg NoNeg ARISTA09T0
fc00::66 4 64010 75 123 0 0 0 00:03:29 NoNeg NoNeg ARISTA10T0
fc00::6a 4 64011 76 129 0 0 0 00:03:30 NoNeg NoNeg ARISTA11T0
fc00::6e 4 64012 75 128 0 0 0 00:03:29 NoNeg NoNeg ARISTA12T0
fc00::72 4 64013 75 128 0 0 0 00:03:29 NoNeg NoNeg ARISTA13T0
fc00::76 4 64014 76 129 0 0 0 00:03:30 NoNeg NoNeg ARISTA14T0
fc00::7a 4 64015 76 129 0 0 0 00:03:30 NoNeg NoNeg ARISTA15T0
fc00::7e 4 64016 76 129 0 0 0 00:03:30 NoNeg NoNeg ARISTA16T0

Total number of neighbors 48

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, thanks for the information.

@zhangyanzhao
Copy link
Contributor

This is the last open PR for the feature. Can reviewers help to finish the review? Thanks.

Add BGP suppress fib pending script
docs/testplan/BGP-Suppress-FIB-Pending-test-plan.md
Copy link
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

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

LGTM

@StormLiangMS StormLiangMS merged commit fe63723 into sonic-net:master Jun 2, 2023
@bingwang-ms
Copy link
Collaborator

@echuawu The test case is consistently failing on SN4600 T1 testbed. Did you see the issue on same platform?

mrkcmo pushed a commit to Azarack/sonic-mgmt that referenced this pull request Oct 3, 2023
Add BGP suppress fib pending script
docs/testplan/BGP-Suppress-FIB-Pending-test-plan.md

Description of PR
Summary:
Add a new script to cover BGP suppress fib pending function test.

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?
This functionality provides feedback to FRR so that routes are not advertised until they are installed in the FIB. Support for bgp suppress-fib-pending s required in SONIC.

Supported testbed topology if it's a new test case?
T1 topology testbed
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Jan 25, 2024
Add BGP suppress fib pending script
docs/testplan/BGP-Suppress-FIB-Pending-test-plan.md

Description of PR
Summary:
Add a new script to cover BGP suppress fib pending function test.

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?
This functionality provides feedback to FRR so that routes are not advertised until they are installed in the FIB. Support for bgp suppress-fib-pending s required in SONIC.

Supported testbed topology if it's a new test case?
T1 topology testbed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants