Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions tests/crm/test_crm.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,11 +807,16 @@ def test_acl_counter(duthosts, rand_one_dut_hostname, collector):

def test_crm_fdb_entry(duthosts, rand_one_dut_hostname, tbinfo):
duthost = duthosts[rand_one_dut_hostname]
if "t0" not in tbinfo["topo"]["name"].lower():
pytest.skip("Unsupported topology, expected to run only on 'T0*' topology")

# Test is applicable only for topologies which contain disabled host interface ports
topology = tbinfo["topo"]["properties"]["topology"]
if "disabled_host_interfaces" not in topology:
pytest.skip("Unsupported topology, test requires disabled ports for dummy VLAN interface")
get_fdb_stats = "redis-cli --raw -n 2 HMGET CRM:STATS crm_stats_fdb_entry_used crm_stats_fdb_entry_available"
iface = "Ethernet0"
cfg_facts = duthost.config_facts(host=duthost.hostname, source="persistent")['ansible_facts']
port_dict = dict(zip(cfg_facts['port_index_map'].values(), cfg_facts['port_index_map'].keys()))
# Use for test disabled in topo host port to create dummy VLAN interface
disabled_port_id = [id for id in topology["disabled_host_interfaces"]][0]
iface = port_dict[disabled_port_id]
vlan_id = 2
cmd_add_vlan_member = "config vlan member add {vid} {iface}"
cmd_add_vlan = "config vlan add {}".format(vlan_id)
Expand Down