[202012] [minigraph] Remove SLB and bgp monitor peers for storage backend (#12262)

Why I did it
This is to backport #12251 to 202012

Signed-off-by: Neetha John <nejo@microsoft.com>
This commit is contained in:
Neetha John 2022-10-10 14:29:41 -07:00 committed by GitHub
parent 3d8fbf4bca
commit 1b99c605a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -1595,6 +1595,11 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
if is_storage_device: if is_storage_device:
results['DEVICE_METADATA']['localhost']['storage_device'] = "true" results['DEVICE_METADATA']['localhost']['storage_device'] = "true"
# remove bgp monitor and slb peers for storage backend
if is_storage_device and 'BackEnd' in current_device['type']:
results['BGP_MONITORS'] = {}
results['BGP_PEER_RANGE'] = {}
results['VLAN'] = vlans results['VLAN'] = vlans
results['VLAN_MEMBER'] = vlan_members results['VLAN_MEMBER'] = vlan_members

View File

@ -767,6 +767,14 @@ class TestCfgGen(TestCase):
output = self.run_script(argument) output = self.run_script(argument)
self.assertEqual(output.strip(), "") self.assertEqual(output.strip(), "")
# SLB and BGP Monitor table does not exist
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "BGP_PEER_RANGE"'
output = self.run_script(argument)
self.assertEqual(output.strip(), "{}")
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "BGP_MONITORS"'
output = self.run_script(argument)
self.assertEqual(output.strip(), "{}")
# ACL_TABLE should not contain EVERFLOW related entries # ACL_TABLE should not contain EVERFLOW related entries
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "ACL_TABLE"' argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "ACL_TABLE"'
output = self.run_script(argument) output = self.run_script(argument)