From 16e3a729256216ee5083f4bf8d4d71243c8440d7 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 e5f6869b0a..094d62bf26 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -1749,12 +1749,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 d1d5b898b4..b4e3a6dc36 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -959,6 +959,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)