From bc8b34c49a56d41b9f2add25530215cde3b43dea Mon Sep 17 00:00:00 2001 From: judyjoseph <53951155+judyjoseph@users.noreply.github.com> Date: Tue, 21 Feb 2023 11:35:38 -0800 Subject: [PATCH] Voq Chassis: Add the Recirc ports to the INTERFACES table to make it routed intf (#13779) * VOQ: Add the Recirc ports to the INTERFACES table to make it routed intf * Add a test to cover Recir port generation in INTERFACE table --- src/sonic-config-engine/minigraph.py | 5 ++++- src/sonic-config-engine/tests/test_cfggen.py | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index df8d1fe21d..fe178a9113 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -1726,12 +1726,15 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if inband_port in ports.keys(): ports[inband_port]['admin_status'] = 'up' - # bring up the recirc port for voq chassis + # bring up the recirc port for voq chassis, Set it as routed interface for port, port_attributes in ports.items(): port_role = port_attributes.get('role', None) if port_role == 'Rec': ports[port]['admin_status'] = 'up' + #Add the Recirc ports to the INTERFACES table to make it routed intf + results['INTERFACE'].update({port : {}}) + results['PORT'] = ports results['CONSOLE_PORT'] = console_ports diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 6279a7bfbd..0d0f8010d3 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -961,6 +961,14 @@ class TestCfgGen(TestCase): "admin_status": "up" }) + argument = ["-j", self.macsec_profile, "-m", self.sample_graph_voq, "-p", self.voq_port_config, "--var-json", "INTERFACE"] + output = self.run_script(argument) + output_dict = utils.to_dict(output.strip()) + self.assertDictEqual( + output_dict['Ethernet-Rec0'], + {} + ) + def test_minigraph_dhcp(self): argument = '-m "' + self.sample_graph_simple_case + '" -p "' + self.port_config + '" -v DHCP_RELAY' output = self.run_script(argument)