Update minigraph testcases (#18321)

This commit is contained in:
Zhijian Li 2024-03-13 06:07:08 +08:00 committed by GitHub
parent 283d1ff97d
commit b05f488ba6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -528,7 +528,7 @@ class TestCfgGenCaseInsensitive(TestCase):
}
# TC1: Minigraph contains acl table type BmcData
sample_mx_graph = os.path.join(self.test_dir,'simple-sample-graph-mx.xml')
result = minigraph.parse_xml(sample_mx_graph)
result = minigraph.parse_xml(sample_mx_graph, port_config_file=self.port_config)
self.assertIn('ACL_TABLE_TYPE', result)
self.assertIn('BMCDATA', result['ACL_TABLE_TYPE'])
self.assertIn('BMCDATAV6', result['ACL_TABLE_TYPE'])
@ -537,7 +537,7 @@ class TestCfgGenCaseInsensitive(TestCase):
self.assertDictEqual(result['ACL_TABLE']['BMC_ACL_NORTHBOUND'], expected_acl_table_bmc_acl_northbound)
self.assertDictEqual(result['ACL_TABLE']['BMC_ACL_NORTHBOUND_V6'], expected_acl_table_bmc_acl_northbound_v6)
# TC2: Minigraph doesn't contain acl table type BmcData
result = minigraph.parse_xml(self.sample_graph)
result = minigraph.parse_xml(self.sample_graph, port_config_file=self.port_config)
self.assertNotIn('ACL_TABLE_TYPE', result)
def test_parse_device_desc_xml_mgmt_interface(self):
@ -564,7 +564,7 @@ class TestCfgGenCaseInsensitive(TestCase):
mgmt_graphs = ['simple-sample-graph-mx.xml', 'simple-sample-graph-m0.xml']
for graph in mgmt_graphs:
graph_path = os.path.join(self.test_dir, graph)
result = minigraph.parse_xml(graph_path)
result = minigraph.parse_xml(graph_path, port_config_file=self.port_config)
self.assertIn('FLEX_COUNTER_TABLE', result)
for counter in expected_mgmt_disabled_counters:
self.assertIn(counter, result['FLEX_COUNTER_TABLE'])
@ -573,5 +573,5 @@ class TestCfgGenCaseInsensitive(TestCase):
if counter in result['FLEX_COUNTER_TABLE']:
self.assertDictEqual(result['FLEX_COUNTER_TABLE'][counter], {'FLEX_COUNTER_STATUS': 'enable'})
# TC2: For other minigraph, result should not contain FLEX_COUNTER_TABLE
result = minigraph.parse_xml(self.sample_graph)
result = minigraph.parse_xml(self.sample_graph, port_config_file=self.port_config)
self.assertNotIn('FLEX_COUNTER_TABLE', result)