Skip to content

Commit ed71c12

Browse files
abdosimssonicbld
authored andcommitted
Enable BFD for Static Route for chassis-packet. (sonic-net#15383)
*What I did: Enable BFD for Static Route for chassis-packet. This will trigger the use of the feature as defined in here: sonic-net#13789 Signed-off-by: Abhishek Dosi <[email protected]>
1 parent aa01630 commit ed71c12

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/sonic-config-engine/minigraph.py

+4
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
19861986
port['mux_cable'] = "true"
19871987

19881988
if static_routes:
1989+
# Enable static Route BFD by default for static route in chassis-packet
1990+
if switch_type == "chassis-packet":
1991+
for pfx, data in static_routes.items():
1992+
data.update({"bfd":"true"})
19891993
results['STATIC_ROUTE'] = static_routes
19901994

19911995
for nghbr in list(neighbors.keys()):

src/sonic-config-engine/tests/test_cfggen.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1029,14 +1029,14 @@ def test_minigraph_bgp_packet_chassis_static_route(self):
10291029
output = self.run_script(argument)
10301030
self.assertEqual(
10311031
utils.to_dict(output.strip()),
1032-
utils.to_dict("{'8.0.0.1/32': {'nexthop': '192.168.1.2,192.168.2.2', 'ifname': 'PortChannel40,PortChannel50', 'advertise':'false'}}")
1032+
utils.to_dict("{'8.0.0.1/32': {'nexthop': '192.168.1.2,192.168.2.2', 'ifname': 'PortChannel40,PortChannel50', 'advertise':'false', 'bfd':'true'}}")
10331033
)
10341034

10351035
argument = ['-m', self.packet_chassis_graph, '-p', self.packet_chassis_port_ini, '-n', "asic1", '-v', "STATIC_ROUTE"]
10361036
output = self.run_script(argument)
10371037
self.assertEqual(
10381038
utils.to_dict(output.strip()),
1039-
utils.to_dict("{'8.0.0.1/32': {'nexthop': '192.168.1.2,192.168.2.2', 'ifname': 'PortChannel40,PortChannel50', 'advertise':'false'}}")
1039+
utils.to_dict("{'8.0.0.1/32': {'nexthop': '192.168.1.2,192.168.2.2', 'ifname': 'PortChannel40,PortChannel50', 'advertise':'false', 'bfd':'true'}}")
10401040
)
10411041

10421042
def test_minigraph_bgp_packet_chassis_vlan_subintf(self):

src/sonic-yang-models/yang-models/sonic-static-route.yang

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ module sonic-static-route {
5454
}
5555
default "false";
5656
}
57+
leaf bfd {
58+
type string {
59+
pattern "((true|false),)*(true|false)";
60+
}
61+
default "false";
62+
}
5763
}
5864
list STATIC_ROUTE_LIST {
5965
key "vrf_name prefix";

0 commit comments

Comments
 (0)