Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,53 @@
"BGP_SENTINEL_INVALID_RANGE_IPV6": {
"desc": "does not satisfy.",
"eStr": "Invalid value \"fc00:f0::/129\" in \"ip_range\" element."
},
"BGP_GLOBALS_RR_CLUSTER_ID_DOTTED_VALID": {
"desc": "rr_cluster_id accepts dotted-quad notation."
},
"BGP_GLOBALS_RR_CLUSTER_ID_INTEGER_VALID": {
"desc": "rr_cluster_id accepts a 32-bit integer (top of range, unambiguously not dotted-quad)."
},
"BGP_GLOBALS_RR_CLUSTER_ID_INVALID": {
"desc": "rr_cluster_id must reject a value that is neither an IPv4 address nor a 32-bit integer.",
"eStrKey": "InvalidValue",
"eStr": ["rr_cluster_id"]
},
"BGP_GLOBALS_AF_SRPOLICY_INVALID": {
"desc": "BGP_GLOBALS_AF has no global AFI-SAFI configuration for SR-Policy SAFI; afi_safi=ipv4_srpolicy must be rejected outright by the restricted key type.",
"eStrKey": "InvalidValue",
"eStr": ["afi_safi"]
},
"BGP_GLOBALS_AF_AFI_SAFI_HYPHENATED_INVALID": {
"desc": "BGP_GLOBALS_AF with a hyphenated afi_safi spelling (ipv4-unicast) must be rejected; the canonical form is underscore-separated.",
"eStrKey": "InvalidValue",
"eStr": ["afi_safi"]
},
"BGP_GLOBALS_AF_AGGREGATE_ADDR_SRPOLICY_INVALID": {
"desc": "BGP_GLOBALS_AF_AGGREGATE_ADDR with an SR-Policy afi_safi must be rejected by the restricted key type.",
"eStrKey": "InvalidValue",
"eStr": ["afi_safi"]
},
"BGP_GLOBALS_AF_NETWORK_SRPOLICY_INVALID": {
"desc": "BGP_GLOBALS_AF_NETWORK with an SR-Policy afi_safi must be rejected by the restricted key type.",
"eStrKey": "InvalidValue",
"eStr": ["afi_safi"]
},
"BGP_NEIGHBOR_AF_L2VPN_EVPN_VALID": {
"desc": "BGP_NEIGHBOR_AF accepts l2vpn_evpn, which is required to activate a neighbor for EVPN."
},
"BGP_NEIGHBOR_AF_AFI_SAFI_HYPHENATED_INVALID": {
"desc": "BGP_NEIGHBOR_AF with a hyphenated afi_safi spelling (ipv4-unicast) must be rejected; the canonical form is underscore-separated.",
"eStrKey": "InvalidValue",
"eStr": ["afi_safi"]
},
"BGP_PEER_GROUP_AF_SRPOLICY_VALID": {
"desc": "BGP_PEER_GROUP_AF (with BGP_NEIGHBOR_AF) is one of only two tables carrying the full bgp_afi_safi vocabulary; both SR-Policy families must remain admissible keys."
},
"BGP_PEER_GROUP_AF_AFI_SAFI_HYPHENATED_INVALID": {
"desc": "BGP_PEER_GROUP_AF with a hyphenated afi_safi spelling (ipv4-unicast) must be rejected; the canonical form is underscore-separated.",
"eStrKey": "InvalidValue",
"eStr": ["afi_safi"]
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@
"BGP_DEVICE_GLOBAL_CONFED" : {
"desc": "Load bgp device global table with confederation asn and peers"
},
"BGP_DEVICE_GLOBAL_CONFED_PEERS_SINGLE_VALID" : {
"desc": "Load bgp device global table with a single confederation sub-ASN and no separator"
},
"BGP_DEVICE_GLOBAL_CONFED_PEERS_TRAILING_SEPARATOR_INVALID" : {
"desc": "A trailing semi-colon in the confederation peers list must be rejected",
"eStrKey": "Pattern",
"eStr": ["peers"]
},
"BGP_DEVICE_GLOBAL_CONFED_PEERS_NON_NUMERIC_INVALID" : {
"desc": "A non-numeric sub-ASN in the confederation peers list must be rejected",
"eStrKey": "Pattern",
"eStr": ["peers"]
},
"BGP_DEVICE_GLOBAL_CONFED_INVALID_ASN" : {
"desc": "Load bgp device global table with confederation invalid asn",
"eStrKey": "InvalidValue",
Expand Down
262 changes: 262 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,268 @@
]
}
}
},

"BGP_GLOBALS_AF_SRPOLICY_INVALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001
}
]
},
"sonic-bgp-global:BGP_GLOBALS_AF": {
"BGP_GLOBALS_AF_LIST": [
{
"vrf_name": "default",
"afi_safi": "ipv4_srpolicy"
}
]
}
}
},
"BGP_GLOBALS_AF_AFI_SAFI_HYPHENATED_INVALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001
}
]
},
"sonic-bgp-global:BGP_GLOBALS_AF": {
"BGP_GLOBALS_AF_LIST": [
{
"vrf_name": "default",
"afi_safi": "ipv4-unicast"
}
]
}
}
},
"BGP_GLOBALS_AF_AGGREGATE_ADDR_SRPOLICY_INVALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001
}
]
},
"sonic-bgp-global:BGP_GLOBALS_AF_AGGREGATE_ADDR": {
"BGP_GLOBALS_AF_AGGREGATE_ADDR_LIST": [
{
"vrf_name": "default",
"afi_safi": "ipv4_srpolicy",
"ip_prefix": "192.168.0.0/24"
}
]
}
}
},
"BGP_GLOBALS_AF_NETWORK_SRPOLICY_INVALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001
}
]
},
"sonic-bgp-global:BGP_GLOBALS_AF_NETWORK": {
"BGP_GLOBALS_AF_NETWORK_LIST": [
{
"vrf_name": "default",
"afi_safi": "ipv4_srpolicy",
"ip_prefix": "192.168.0.0/24"
}
]
}
}
},
"BGP_NEIGHBOR_AF_L2VPN_EVPN_VALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001
}
]
}
},
"sonic-bgp-neighbor:sonic-bgp-neighbor": {
"sonic-bgp-neighbor:BGP_NEIGHBOR": {
"BGP_NEIGHBOR_LIST": [
{
"vrf_name": "default",
"neighbor": "20.0.0.1",
"local_asn": 1,
"name": "BGP nbr 1",
"asn": 65003
}
]
},
"sonic-bgp-neighbor:BGP_NEIGHBOR_AF": {
"BGP_NEIGHBOR_AF_LIST": [
{
"vrf_name": "default",
"neighbor": "20.0.0.1",
"afi_safi": "l2vpn_evpn",
"admin_status": "up"
}
]
}
}
},
"BGP_NEIGHBOR_AF_AFI_SAFI_HYPHENATED_INVALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001
}
]
}
},
"sonic-bgp-neighbor:sonic-bgp-neighbor": {
"sonic-bgp-neighbor:BGP_NEIGHBOR": {
"BGP_NEIGHBOR_LIST": [
{
"vrf_name": "default",
"neighbor": "20.0.0.1",
"local_asn": 1,
"name": "BGP nbr 1",
"asn": 65003
}
]
},
"sonic-bgp-neighbor:BGP_NEIGHBOR_AF": {
"BGP_NEIGHBOR_AF_LIST": [
{
"vrf_name": "default",
"neighbor": "20.0.0.1",
"afi_safi": "ipv4-unicast",
"admin_status": "up"
}
]
}
}
},
"BGP_PEER_GROUP_AF_AFI_SAFI_HYPHENATED_INVALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001
}
]
}
},
"sonic-bgp-peergroup:sonic-bgp-peergroup": {
"sonic-bgp-peergroup:BGP_PEER_GROUP": {
"BGP_PEER_GROUP_LIST": [
{
"vrf_name": "default",
"peer_group_name": "PG1"
}
]
},
"sonic-bgp-peergroup:BGP_PEER_GROUP_AF": {
"BGP_PEER_GROUP_AF_LIST": [
{
"vrf_name": "default",
"peer_group_name": "PG1",
"afi_safi": "ipv4-unicast",
"admin_status": "up"
}
]
}
}
},
"BGP_PEER_GROUP_AF_SRPOLICY_VALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001
}
]
}
},
"sonic-bgp-peergroup:sonic-bgp-peergroup": {
"sonic-bgp-peergroup:BGP_PEER_GROUP": {
"BGP_PEER_GROUP_LIST": [
{
"vrf_name": "default",
"peer_group_name": "PG1"
}
]
},
"sonic-bgp-peergroup:BGP_PEER_GROUP_AF": {
"BGP_PEER_GROUP_AF_LIST": [
{
"vrf_name": "default",
"peer_group_name": "PG1",
"afi_safi": "ipv4_srpolicy",
"admin_status": "up"
},
{
"vrf_name": "default",
"peer_group_name": "PG1",
"afi_safi": "ipv6_srpolicy",
"admin_status": "up"
}
]
}
}
},
"BGP_GLOBALS_RR_CLUSTER_ID_DOTTED_VALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001,
"rr_cluster_id": "1.1.1.1"
}
]
}
}
},
"BGP_GLOBALS_RR_CLUSTER_ID_INTEGER_VALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001,
"rr_cluster_id": "4294967295"
}
]
}
}
},
"BGP_GLOBALS_RR_CLUSTER_ID_INVALID": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001,
"rr_cluster_id": "cluster-one"
}
]
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,36 @@
}
}
},
"BGP_DEVICE_GLOBAL_CONFED_PEERS_SINGLE_VALID": {
"sonic-bgp-device-global:sonic-bgp-device-global": {
"sonic-bgp-device-global:BGP_DEVICE_GLOBAL": {
"CONFED": {
"asn": 65100,
"peers": "66000"
}
}
}
},
"BGP_DEVICE_GLOBAL_CONFED_PEERS_TRAILING_SEPARATOR_INVALID": {
"sonic-bgp-device-global:sonic-bgp-device-global": {
"sonic-bgp-device-global:BGP_DEVICE_GLOBAL": {
"CONFED": {
"asn": 65100,
"peers": "66000;63000;"
}
}
}
},
"BGP_DEVICE_GLOBAL_CONFED_PEERS_NON_NUMERIC_INVALID": {
"sonic-bgp-device-global:sonic-bgp-device-global": {
"sonic-bgp-device-global:BGP_DEVICE_GLOBAL": {
"CONFED": {
"asn": 65100,
"peers": "66000;abc"
}
}
}
},
"BGP_DEVICE_GLOBAL_CONFED_INVALID_ASN": {
"sonic-bgp-device-global:sonic-bgp-device-global": {
"sonic-bgp-device-global:BGP_DEVICE_GLOBAL": {
Expand Down
Loading
Loading