[minigraph.py]: Add VLAN_INTERFACE attributes for dual ToR devices (#5951)
* If a device has subtype = 'DualToR', then enable proxy ARP and gratuitous ARP.
This commit is contained in:
parent
31404dc43a
commit
3b27afe377
@ -1092,10 +1092,24 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
|
||||
for intf in intfs:
|
||||
if intf[0][0:4] == 'Vlan':
|
||||
vlan_intfs[intf] = {}
|
||||
vlan_intfs[intf[0]] = {}
|
||||
|
||||
if bool(results['PEER_SWITCH']):
|
||||
vlan_intfs[intf[0]] = {
|
||||
'proxy_arp': 'enabled',
|
||||
'grat_arp': 'enabled'
|
||||
}
|
||||
else:
|
||||
vlan_intfs[intf[0]] = {}
|
||||
elif intf[0] in vlan_invert_mapping:
|
||||
vlan_intfs[(vlan_invert_mapping[intf[0]], intf[1])] = {}
|
||||
vlan_intfs[vlan_invert_mapping[intf[0]]] = {}
|
||||
|
||||
if bool(results['PEER_SWITCH']):
|
||||
vlan_intfs[vlan_invert_mapping[intf[0]]] = {
|
||||
'proxy_arp': 'enabled',
|
||||
'grat_arp': 'enabled'
|
||||
}
|
||||
else:
|
||||
vlan_intfs[vlan_invert_mapping[intf[0]]] = {}
|
||||
elif intf[0][0:11] == 'PortChannel':
|
||||
pc_intfs[intf] = {}
|
||||
pc_intfs[intf[0]] = {}
|
||||
|
@ -96,11 +96,23 @@ class TestCfgGenCaseInsensitive(TestCase):
|
||||
output = self.run_script(argument)
|
||||
self.assertEqual(output.strip(), "{('Vlan1000', 'Ethernet8'): {'tagging_mode': 'untagged'}}")
|
||||
|
||||
def test_minigraph_vlan_interfaces(self):
|
||||
def test_minigraph_vlan_interfaces_keys(self):
|
||||
argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE.keys()|list"'
|
||||
output = self.run_script(argument)
|
||||
self.assertEqual(output.strip(), "[('Vlan1000', '192.168.0.1/27'), 'Vlan1000']")
|
||||
|
||||
def test_minigraph_vlan_interfaces(self):
|
||||
argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE"'
|
||||
output = self.run_script(argument)
|
||||
expected_table = {
|
||||
'Vlan1000|192.168.0.1/27': {},
|
||||
'Vlan1000': {
|
||||
'proxy_arp': 'enabled',
|
||||
'grat_arp': 'enabled'
|
||||
}
|
||||
}
|
||||
self.assertEqual(utils.to_dict(output.strip()), expected_table)
|
||||
|
||||
def test_minigraph_portchannels(self):
|
||||
argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v PORTCHANNEL'
|
||||
output = self.run_script(argument)
|
||||
|
Reference in New Issue
Block a user