Skip to content

Commit 87066ab

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

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
@@ -1982,6 +1982,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
19821982
port['mux_cable'] = "true"
19831983

19841984
if static_routes:
1985+
# Enable static Route BFD by default for static route in chassis-packet
1986+
if switch_type == "chassis-packet":
1987+
for pfx, data in static_routes.items():
1988+
data.update({"bfd":"true"})
19851989
results['STATIC_ROUTE'] = static_routes
19861990

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

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

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

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

10451045
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)