Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a couple issues in change_lag_lacp_timer #15778

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
33 changes: 19 additions & 14 deletions tests/qos/qos_sai_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2588,38 +2588,43 @@ 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))
arista-nwolfe marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -590,7 +590,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
Loading