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
This commit is contained in:
judyjoseph 2023-02-21 11:35:38 -08:00 committed by GitHub
parent 2c22d9affc
commit bc2cb46ec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

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