Skip to content

[Yang] Fix Yang model of BGP Allowed Prefix#20550

Merged
StormLiangMS merged 3 commits intosonic-net:masterfrom
lizhijianrd:fix-bgp-allowed-prefix-yang-model
Nov 21, 2024
Merged

[Yang] Fix Yang model of BGP Allowed Prefix#20550
StormLiangMS merged 3 commits intosonic-net:masterfrom
lizhijianrd:fix-bgp-allowed-prefix-yang-model

Conversation

@lizhijianrd
Copy link
Contributor

@lizhijianrd lizhijianrd commented Oct 21, 2024

Why I did it

Bugfix for Yang model of BGP Allowed Prefix.

  1. Support optional NEIGHBOR_TYPE in key.
  2. Support optional le and ge in prefixes_v4/prefixes_v6 list (e.g., 10.20.30.0/24 le 30).
Work item tracking
  • Microsoft ADO (number only): 30001113

How I did it

Updated sonic-bgp-allowed-prefix.yang.

  1. Define optional value NEIGHBOR_TYPE in key.
  2. Define type bgp-allowed-ipv4-prefix and bgp-allowed-ipv6-prefix to support the optional suffix in prefixes_v4/prefixes_v6 list.

How to verify it

Verified by UT:

collected 870 items

tests/test_sonic_yang_models.py ..                                                        [  0%]
tests/yang_model_pytests/test_crm.py .................................................... [  6%]
......................................................................................... [ 16%]
......................................................................................... [ 26%]
......................................................................................... [ 36%]
......................................................................................... [ 47%]
......................................................................................... [ 57%]
.......................                                                                   [ 60%]
tests/yang_model_pytests/test_dash_crm.py ............................................... [ 65%]
......................................................................................... [ 75%]
......................................................................................... [ 85%]
......................................................................................... [ 96%]
........................                                                                  [ 98%]
tests/yang_model_pytests/test_smart_switch.py .........                                   [ 99%]
tests/yang_model_tests/test_yang_model.py .                                               [100%]

===================================== 870 passed in 33.19s ======================================

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@StormLiangMS StormLiangMS requested a review from wen587 October 21, 2024 07:43
@wen587 wen587 requested a review from ganglyu October 23, 2024 06:23
}

container sonic-bgp-allowed-prefix {
container BGP_ALLOWED_PREFIXES {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check sample YANG udpate PR here: #19358.
Need testcase to verify the changes.

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 @wen587, I've updated unittest. Can you please help review?

@lizhijianrd lizhijianrd marked this pull request as ready for review November 19, 2024 10:25
@lizhijianrd lizhijianrd requested a review from wen587 November 19, 2024 10:31
Copy link
Contributor

@wen587 wen587 left a comment

Choose a reason for hiding this comment

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

lgttm

Copy link
Contributor

@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 ce914e1 into sonic-net:master Nov 21, 2024
@lizhijianrd lizhijianrd deleted the fix-bgp-allowed-prefix-yang-model branch November 21, 2024 08:51
@lizhijianrd
Copy link
Contributor Author

Hi @bingwang-ms, can you please help backport 202405? Thanks.

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Nov 21, 2024
Why I did it
Bugfix for Yang model of BGP Allowed Prefix.

Support optional NEIGHBOR_TYPE in key.
Support optional le and ge in prefixes_v4/prefixes_v6 list (e.g., 10.20.30.0/24 le 30).
Work item tracking
Microsoft ADO (number only): 30001113
How I did it
Updated sonic-bgp-allowed-prefix.yang.

Define optional value NEIGHBOR_TYPE in key.
Define type bgp-allowed-ipv4-prefix and bgp-allowed-ipv6-prefix to support the optional suffix in prefixes_v4/prefixes_v6 list.
How to verify it
Verified by UT:
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #20887

mssonicbld pushed a commit that referenced this pull request Nov 22, 2024
Why I did it
Bugfix for Yang model of BGP Allowed Prefix.

Support optional NEIGHBOR_TYPE in key.
Support optional le and ge in prefixes_v4/prefixes_v6 list (e.g., 10.20.30.0/24 le 30).
Work item tracking
Microsoft ADO (number only): 30001113
How I did it
Updated sonic-bgp-allowed-prefix.yang.

Define optional value NEIGHBOR_TYPE in key.
Define type bgp-allowed-ipv4-prefix and bgp-allowed-ipv6-prefix to support the optional suffix in prefixes_v4/prefixes_v6 list.
How to verify it
Verified by UT:
VladimirKuk pushed a commit to Marvell-switching/sonic-buildimage that referenced this pull request Jan 21, 2025
Why I did it
Bugfix for Yang model of BGP Allowed Prefix.

Support optional NEIGHBOR_TYPE in key.
Support optional le and ge in prefixes_v4/prefixes_v6 list (e.g., 10.20.30.0/24 le 30).
Work item tracking
Microsoft ADO (number only): 30001113
How I did it
Updated sonic-bgp-allowed-prefix.yang.

Define optional value NEIGHBOR_TYPE in key.
Define type bgp-allowed-ipv4-prefix and bgp-allowed-ipv6-prefix to support the optional suffix in prefixes_v4/prefixes_v6 list.
How to verify it
Verified by UT:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants