Skip to content

Commit

Permalink
support for static-route yang model (#11932)
Browse files Browse the repository at this point in the history
*[Yang] support for static-route yang model #11932
  • Loading branch information
UmaMaven authored Sep 7, 2022
1 parent 3b9bbf7 commit 38cc35f
Show file tree
Hide file tree
Showing 5 changed files with 1,220 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def run(self):
'./yang-models/sonic-pfc-priority-queue-map.yang',
'./yang-models/sonic-pfc-priority-priority-group-map.yang',
'./yang-models/sonic-port-qos-map.yang',
'./yang-models/sonic-static-route.yang',
'./yang-models/sonic-macsec.yang']),
('cvlyang-models', ['./cvlyang-models/sonic-acl.yang',
'./cvlyang-models/sonic-bgp-common.yang',
Expand Down Expand Up @@ -214,6 +215,7 @@ def run(self):
'./cvlyang-models/sonic-pfc-priority-queue-map.yang',
'./cvlyang-models/sonic-pfc-priority-priority-group-map.yang',
'./cvlyang-models/sonic-port-qos-map.yang',
'./cvlyang-models/sonic-static-route.yang',
'./cvlyang-models/sonic-macsec.yang']),
],
zip_safe=False,
Expand Down
9 changes: 9 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1997,6 +1997,15 @@
"console_mgmt": {
"enabled": "yes"
}
},
"STATIC_ROUTE": {
"default|20.20.20.0/24": {
"blackhole": "false",
"distance": "1",
"ifname": "Ethernet14",
"nexthop": "10.184.229.212",
"nexthop-vrf": "default"
}
}
},
"SAMPLE_CONFIG_DB_UNKNOWN": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"STATIC_ROUTE_TEST": {
"desc": "Configure basic static route with default VRFs with PREFIX"
},
"STATIC_ROUTE_TEST_WITH_INTERFACE": {
"desc": "Configure with nexthop as interface instead of IP address"
},
"STATIC_ROUTE_TEST_WITH_BLACKHOLE": {
"desc": "Configure with nexthop as blackhole"
},
"STATIC_ROUTE_TEST_WITH_VRF": {
"desc": "Configure with routes in non default VRF"
},
"STATIC_ROUTE_TEST_WITH_KEY_VRF_MGMT": {
"desc": "Configure with routes in mgmt VRF as key"
},
"STATIC_ROUTE_TEST_WITH_VRF_MGMT": {
"desc": "Configure with routes with mgmt VRF as next hop"
},
"STATIC_ROUTE_TEST_WITH_VRF_LEAK": {
"desc": "Configure with route leak across VRFS"
},
"STATIC_ROUTE_TEST_ECMP": {
"desc": "Configure comma separated values for ECMP, with nexthop as PREFIX"
},
"STATIC_ROUTE_TEST_ECMP_WITH_INTERFACE": {
"desc": "Configure comma separated values with nexthop as INTERFACE"
},
"STATIC_ROUTE_TEST_ECMP_WITH_MGMT": {
"desc": "Configure comma separated values with one nexthop as mgmt"
},
"STATIC_ROUTE_TEST_DISTANCE_INVALID": {
"desc": "Configure with invalid distance number",
"eStrKey": "Pattern"
},
"STATIC_ROUTE_TEST_BLACKHOLE_INVALID": {
"desc": "Configure with invalid value for blackhole",
"eStrKey": "Pattern"
},
"STATIC_ROUTE_TEST_NEXTHOP_VRF_INVALID": {
"desc": "Configure with invalid value for VRF",
"eStrKey": "Pattern"
},
"STATIC_ROUTE_TEST_ECMP_DISTANCE_INVALID": {
"desc": "Configure with invalid distance for ECMP",
"eStrKey": "Pattern"
},
"STATIC_ROUTE_TEST_ECMP_BLACKHOLE_INVALID": {
"desc": "Configure with invalid blackhop for ECMP",
"eStrKey": "Pattern"
},
"STATIC_ROUTE_TEST_ECMP_NEXTHOP_VRF_INVALID": {
"desc": "Configure with invalid vrf for ECMP",
"eStrKey": "Pattern"
}

}
Loading

0 comments on commit 38cc35f

Please sign in to comment.