Skip to content

Commit 38cc35f

Browse files
authored
support for static-route yang model (#11932)
*[Yang] support for static-route yang model #11932
1 parent 3b9bbf7 commit 38cc35f

File tree

5 files changed

+1220
-0
lines changed

5 files changed

+1220
-0
lines changed

src/sonic-yang-models/setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def run(self):
158158
'./yang-models/sonic-pfc-priority-queue-map.yang',
159159
'./yang-models/sonic-pfc-priority-priority-group-map.yang',
160160
'./yang-models/sonic-port-qos-map.yang',
161+
'./yang-models/sonic-static-route.yang',
161162
'./yang-models/sonic-macsec.yang']),
162163
('cvlyang-models', ['./cvlyang-models/sonic-acl.yang',
163164
'./cvlyang-models/sonic-bgp-common.yang',
@@ -214,6 +215,7 @@ def run(self):
214215
'./cvlyang-models/sonic-pfc-priority-queue-map.yang',
215216
'./cvlyang-models/sonic-pfc-priority-priority-group-map.yang',
216217
'./cvlyang-models/sonic-port-qos-map.yang',
218+
'./cvlyang-models/sonic-static-route.yang',
217219
'./cvlyang-models/sonic-macsec.yang']),
218220
],
219221
zip_safe=False,

src/sonic-yang-models/tests/files/sample_config_db.json

+9
Original file line numberDiff line numberDiff line change
@@ -1997,6 +1997,15 @@
19971997
"console_mgmt": {
19981998
"enabled": "yes"
19991999
}
2000+
},
2001+
"STATIC_ROUTE": {
2002+
"default|20.20.20.0/24": {
2003+
"blackhole": "false",
2004+
"distance": "1",
2005+
"ifname": "Ethernet14",
2006+
"nexthop": "10.184.229.212",
2007+
"nexthop-vrf": "default"
2008+
}
20002009
}
20012010
},
20022011
"SAMPLE_CONFIG_DB_UNKNOWN": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"STATIC_ROUTE_TEST": {
3+
"desc": "Configure basic static route with default VRFs with PREFIX"
4+
},
5+
"STATIC_ROUTE_TEST_WITH_INTERFACE": {
6+
"desc": "Configure with nexthop as interface instead of IP address"
7+
},
8+
"STATIC_ROUTE_TEST_WITH_BLACKHOLE": {
9+
"desc": "Configure with nexthop as blackhole"
10+
},
11+
"STATIC_ROUTE_TEST_WITH_VRF": {
12+
"desc": "Configure with routes in non default VRF"
13+
},
14+
"STATIC_ROUTE_TEST_WITH_KEY_VRF_MGMT": {
15+
"desc": "Configure with routes in mgmt VRF as key"
16+
},
17+
"STATIC_ROUTE_TEST_WITH_VRF_MGMT": {
18+
"desc": "Configure with routes with mgmt VRF as next hop"
19+
},
20+
"STATIC_ROUTE_TEST_WITH_VRF_LEAK": {
21+
"desc": "Configure with route leak across VRFS"
22+
},
23+
"STATIC_ROUTE_TEST_ECMP": {
24+
"desc": "Configure comma separated values for ECMP, with nexthop as PREFIX"
25+
},
26+
"STATIC_ROUTE_TEST_ECMP_WITH_INTERFACE": {
27+
"desc": "Configure comma separated values with nexthop as INTERFACE"
28+
},
29+
"STATIC_ROUTE_TEST_ECMP_WITH_MGMT": {
30+
"desc": "Configure comma separated values with one nexthop as mgmt"
31+
},
32+
"STATIC_ROUTE_TEST_DISTANCE_INVALID": {
33+
"desc": "Configure with invalid distance number",
34+
"eStrKey": "Pattern"
35+
},
36+
"STATIC_ROUTE_TEST_BLACKHOLE_INVALID": {
37+
"desc": "Configure with invalid value for blackhole",
38+
"eStrKey": "Pattern"
39+
},
40+
"STATIC_ROUTE_TEST_NEXTHOP_VRF_INVALID": {
41+
"desc": "Configure with invalid value for VRF",
42+
"eStrKey": "Pattern"
43+
},
44+
"STATIC_ROUTE_TEST_ECMP_DISTANCE_INVALID": {
45+
"desc": "Configure with invalid distance for ECMP",
46+
"eStrKey": "Pattern"
47+
},
48+
"STATIC_ROUTE_TEST_ECMP_BLACKHOLE_INVALID": {
49+
"desc": "Configure with invalid blackhop for ECMP",
50+
"eStrKey": "Pattern"
51+
},
52+
"STATIC_ROUTE_TEST_ECMP_NEXTHOP_VRF_INVALID": {
53+
"desc": "Configure with invalid vrf for ECMP",
54+
"eStrKey": "Pattern"
55+
}
56+
57+
}

0 commit comments

Comments
 (0)