Skip to content

Commit

Permalink
Fix a couple issues in change_lag_lacp_timer (#15778)
Browse files Browse the repository at this point in the history
This change adds a couple improvements:
-Updated to work with single-asic LCs
-Updated to change the LACP timeout multiplier for all 3 dst_port_id neighbors.

Also made testQosSaiPfcXonLimit use fixture change_lag_lacp_timer

* Change peer_device to vm_host in log message
  • Loading branch information
arista-nwolfe authored Jan 3, 2025
1 parent 00c84f7 commit a201676
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
35 changes: 20 additions & 15 deletions tests/qos/qos_sai_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2601,41 +2601,46 @@ def change_lag_lacp_timer(self, duthosts, get_src_dst_asic_and_duts, tbinfo, nbr

if ('platform_asic' in dutTestParams["basicParams"] and
dutTestParams["basicParams"]["platform_asic"] == "broadcom-dnx"):
src_dut = get_src_dst_asic_and_duts['src_dut']
dst_dut = get_src_dst_asic_and_duts['dst_dut']
if src_dut.sonichost.is_multi_asic and dst_dut.sonichost.is_multi_asic:
dst_mgfacts = dst_dut.get_extended_minigraph_facts(tbinfo)
dst_port_id = dutConfig['testPorts']['dst_port_id']
dst_interface = dutConfig['dutInterfaces'][dst_port_id]
lag_name = ''
for port_ch, port_intf in dst_mgfacts['minigraph_portchannels'].items():
if dst_interface in port_intf['members']:
lag_name = port_ch
dst_mgfacts = dst_dut.get_extended_minigraph_facts(tbinfo)
dst_interfaces = []
dst_interfaces.append(dutConfig['dutInterfaces'][dutConfig['testPorts']['dst_port_id']])
dst_interfaces.append(dutConfig['dutInterfaces'][dutConfig['testPorts']['dst_port_2_id']])
dst_interfaces.append(dutConfig['dutInterfaces'][dutConfig['testPorts']['dst_port_3_id']])
lag_names = []
for port_ch, port_intf in dst_mgfacts['minigraph_portchannels'].items():
for member in port_intf['members']:
if member in dst_interfaces:
lag_names.append(port_ch)
break
if lag_name == '':
yield
return
lag_facts = dst_dut.lag_facts(host=dst_dut.hostname)['ansible_facts']['lag_facts']
if len(lag_names) == 0:
yield
return
lag_facts = dst_dut.lag_facts(host=dst_dut.hostname)['ansible_facts']['lag_facts']
vm_host_neighbor_lag_members = {}
for lag_name in lag_names:
po_interfaces = lag_facts['lags'][lag_name]['po_config']['ports']
vm_neighbors = dst_mgfacts['minigraph_neighbors']
neighbor_lag_intfs = [vm_neighbors[po_intf]['port'] for po_intf in po_interfaces]
neigh_intf = next(iter(po_interfaces.keys()))
peer_device = vm_neighbors[neigh_intf]['name']
vm_host = nbrhosts[peer_device]['host']
vm_host_neighbor_lag_members[vm_host] = []
num = 600
for neighbor_lag_member in neighbor_lag_intfs:
logger.info(
"Changing lacp timer multiplier to 600 for %s in %s" % (neighbor_lag_member, peer_device))
if isinstance(vm_host, EosHost):
vm_host_neighbor_lag_members[vm_host].append(neighbor_lag_member)
vm_host.set_interface_lacp_time_multiplier(neighbor_lag_member, num)

yield
if ('platform_asic' in dutTestParams["basicParams"] and
dutTestParams["basicParams"]["platform_asic"] == "broadcom-dnx"):
if src_dut.sonichost.is_multi_asic and dst_dut.sonichost.is_multi_asic:
for vm_host, neighbor_lag_intfs in vm_host_neighbor_lag_members.items():
for neighbor_lag_member in neighbor_lag_intfs:
logger.info(
"Changing lacp timer multiplier to default for %s in %s" % (neighbor_lag_member, peer_device))
"Changing lacp timer multiplier to default for %s in %s" % (neighbor_lag_member, vm_host))
vm_host.no_lacp_time_multiplier(neighbor_lag_member)

def copy_and_run_set_cir_script_cisco_8000(self, dut, ports, asic="", speed="10000000"):
Expand Down
2 changes: 1 addition & 1 deletion tests/qos/test_qos_sai.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def testPfcStormWithSharedHeadroomOccupancy(
@pytest.mark.parametrize("xonProfile", ["xon_1", "xon_2", "xon_3", "xon_4"])
def testQosSaiPfcXonLimit(
self, get_src_dst_asic_and_duts, xonProfile, ptfhost, dutTestParams, dutConfig, dutQosConfig,
ingressLosslessProfile
ingressLosslessProfile, change_lag_lacp_timer
):
# NOTE: cisco 8800 will skip this test if it's not xon_1 or xon_2
"""
Expand Down

0 comments on commit a201676

Please sign in to comment.