Skip to content

Commit

Permalink
Merge sonic-net/sonic-mgmt 202405 to Azure/sonic-mgmt.msft 202405
Browse files Browse the repository at this point in the history
These changes are picked up in this merge

c74b051 (upstream/202405) Fix the test_nhop_group nexthop map for ld DUTs (sonic-net#16166)
3850e85 [dualtor] Fix `testFdbMacLearning` (sonic-net#16549)
4c5b264 Stabilize `test_snmp_fdb_send_tagged` (sonic-net#16409)
9b999f7 Fix ASIC check in test_pfcwd_function (sonic-net#16535) (sonic-net#16539)
  • Loading branch information
arlakshm authored Jan 17, 2025
2 parents 3f799d3 + 4e66edc commit 6917ba3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 30 deletions.
5 changes: 4 additions & 1 deletion tests/fdb/test_fdb_mac_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from tests.ptf_runner import ptf_runner
from .utils import fdb_table_has_dummy_mac_for_interface
from tests.common.helpers.ptf_tests_helper import upstream_links # noqa F401
from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_rand_selected_tor_m # noqa F401


pytestmark = [
pytest.mark.topology('t0')
Expand Down Expand Up @@ -233,7 +235,8 @@ def bringup_uplink_ports(self, duthost, upstream_links): # noqa F811
duthost.shell("sudo config interface startup {}".format(uplink_intf))

def testFdbMacLearning(self, ptfadapter, duthosts, rand_one_dut_hostname, ptfhost, tbinfo, request, prepare_test,
upstream_links, setup_standby_ports_on_rand_unselected_tor_unconditionally): # noqa F811
upstream_links, setup_standby_ports_on_rand_unselected_tor_unconditionally, # noqa F811
toggle_all_simulator_ports_to_rand_selected_tor_m): # noqa F811
"""
TestFdbMacLearning verifies stale MAC entries are not present in MAC table after doing sonic-clear fdb all
-shut down all ports
Expand Down
50 changes: 25 additions & 25 deletions tests/ipfwd/test_nhop_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,31 +658,31 @@ def built_and_send_tcp_ip_packet():
45: 'c0:ff:ee:00:00:0c', 46: 'c0:ff:ee:00:00:0d',
47: 'c0:ff:ee:00:00:0b', 48: 'c0:ff:ee:00:00:11', 49: 'c0:ff:ee:00:00:0f'}

td3_asic_flow_map = {0: 'c0:ff:ee:00:00:10', 1: 'c0:ff:ee:00:00:0b',
2: 'c0:ff:ee:00:00:12', 3: 'c0:ff:ee:00:00:0d',
4: 'c0:ff:ee:00:00:11', 5: 'c0:ff:ee:00:00:0e',
6: 'c0:ff:ee:00:00:0f', 7: 'c0:ff:ee:00:00:0c',
8: 'c0:ff:ee:00:00:0e', 9: 'c0:ff:ee:00:00:11',
10: 'c0:ff:ee:00:00:0c', 11: 'c0:ff:ee:00:00:0f',
12: 'c0:ff:ee:00:00:12', 13: 'c0:ff:ee:00:00:0d',
14: 'c0:ff:ee:00:00:10', 15: 'c0:ff:ee:00:00:0b',
16: 'c0:ff:ee:00:00:11', 17: 'c0:ff:ee:00:00:0e',
18: 'c0:ff:ee:00:00:0f', 19: 'c0:ff:ee:00:00:0c',
20: 'c0:ff:ee:00:00:10', 21: 'c0:ff:ee:00:00:0b',
22: 'c0:ff:ee:00:00:12', 23: 'c0:ff:ee:00:00:0d',
24: 'c0:ff:ee:00:00:11', 25: 'c0:ff:ee:00:00:0e',
26: 'c0:ff:ee:00:00:0f', 27: 'c0:ff:ee:00:00:0c',
28: 'c0:ff:ee:00:00:0b', 29: 'c0:ff:ee:00:00:10',
30: 'c0:ff:ee:00:00:0d', 31: 'c0:ff:ee:00:00:12',
32: 'c0:ff:ee:00:00:0c', 33: 'c0:ff:ee:00:00:0f',
34: 'c0:ff:ee:00:00:0e', 35: 'c0:ff:ee:00:00:11',
36: 'c0:ff:ee:00:00:0d', 37: 'c0:ff:ee:00:00:12',
38: 'c0:ff:ee:00:00:0b', 39: 'c0:ff:ee:00:00:10',
40: 'c0:ff:ee:00:00:12', 41: 'c0:ff:ee:00:00:0d',
42: 'c0:ff:ee:00:00:10', 43: 'c0:ff:ee:00:00:0b',
44: 'c0:ff:ee:00:00:0e', 45: 'c0:ff:ee:00:00:11',
46: 'c0:ff:ee:00:00:0c', 47: 'c0:ff:ee:00:00:0f',
48: 'c0:ff:ee:00:00:0d', 49: 'c0:ff:ee:00:00:12'}
td3_asic_flow_map = {0: 'c0:ff:ee:00:00:12', 1: 'c0:ff:ee:00:00:10',
2: 'c0:ff:ee:00:00:11', 3: 'c0:ff:ee:00:00:0f',
4: 'c0:ff:ee:00:00:0d', 5: 'c0:ff:ee:00:00:0b',
6: 'c0:ff:ee:00:00:0e', 7: 'c0:ff:ee:00:00:0c',
8: 'c0:ff:ee:00:00:0f', 9: 'c0:ff:ee:00:00:11',
10: 'c0:ff:ee:00:00:10', 11: 'c0:ff:ee:00:00:12',
12: 'c0:ff:ee:00:00:10', 13: 'c0:ff:ee:00:00:12',
14: 'c0:ff:ee:00:00:0f', 15: 'c0:ff:ee:00:00:11',
16: 'c0:ff:ee:00:00:0b', 17: 'c0:ff:ee:00:00:0d',
18: 'c0:ff:ee:00:00:0c', 19: 'c0:ff:ee:00:00:0e',
20: 'c0:ff:ee:00:00:10', 21: 'c0:ff:ee:00:00:12',
22: 'c0:ff:ee:00:00:0f', 23: 'c0:ff:ee:00:00:11',
24: 'c0:ff:ee:00:00:11', 25: 'c0:ff:ee:00:00:0f',
26: 'c0:ff:ee:00:00:12', 27: 'c0:ff:ee:00:00:10',
28: 'c0:ff:ee:00:00:0f', 29: 'c0:ff:ee:00:00:11',
30: 'c0:ff:ee:00:00:10', 31: 'c0:ff:ee:00:00:12',
32: 'c0:ff:ee:00:00:0c', 33: 'c0:ff:ee:00:00:0e',
34: 'c0:ff:ee:00:00:0b', 35: 'c0:ff:ee:00:00:0d',
36: 'c0:ff:ee:00:00:0f', 37: 'c0:ff:ee:00:00:11',
38: 'c0:ff:ee:00:00:10', 39: 'c0:ff:ee:00:00:12',
40: 'c0:ff:ee:00:00:0d', 41: 'c0:ff:ee:00:00:0b',
42: 'c0:ff:ee:00:00:0e', 43: 'c0:ff:ee:00:00:0c',
44: 'c0:ff:ee:00:00:0e', 45: 'c0:ff:ee:00:00:0c',
46: 'c0:ff:ee:00:00:0d', 47: 'c0:ff:ee:00:00:0b',
48: 'c0:ff:ee:00:00:11', 49: 'c0:ff:ee:00:00:0f'}

th2_asic_flow_map = {0: 'c0:ff:ee:00:00:12', 1: 'c0:ff:ee:00:00:10',
2: 'c0:ff:ee:00:00:11',
Expand Down
2 changes: 1 addition & 1 deletion tests/pfcwd/test_pfcwd_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def storm_detect_path(self, dut, port, action):
if self.pfc_wd['fake_storm']:
PfcCmd.set_storm_status(dut, self.queue_oid, "enabled")

if dut.facts['asic_type'] == ["mellanox", "cisco-8000"]:
if dut.facts['asic_type'] in ["mellanox", "cisco-8000"]:
# On Mellanox platform, more time is required for PFC storm being triggered
# as PFC pause sent from Non-Mellanox leaf fanout is not continuous sometimes.
pytest_assert(wait_until(PFC_STORM_TIMEOUT, 2, 0,
Expand Down
15 changes: 12 additions & 3 deletions tests/snmp/test_snmp_fdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import ptf.testutils as testutils
import logging
import pprint
import time

from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401
from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_rand_selected_tor_m # noqa F401
Expand All @@ -17,6 +16,7 @@
from tests.common.helpers.portchannel_to_vlan import vlan_intfs_dict # noqa F401
from tests.common.helpers.portchannel_to_vlan import setup_po2vlan # noqa F401
from tests.common.helpers.portchannel_to_vlan import running_vlan_ports_list
from tests.common.helpers.assertions import pytest_assert

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -46,8 +46,9 @@ def fdb_table_has_no_dynamic_macs(duthost):


@pytest.fixture(scope="module", autouse=True)
def fdb_cleanup(duthost):
def fdb_cleanup(duthosts, rand_one_dut_hostname):
""" cleanup FDB before test run """
duthost = duthosts[rand_one_dut_hostname]
if fdb_table_has_no_dynamic_macs(duthost):
return
else:
Expand Down Expand Up @@ -109,6 +110,7 @@ def test_snmp_fdb_send_tagged(ptfadapter, duthosts, rand_one_dut_hostname,
send_cnt = 0
send_portchannels_cnt = 0
vlan_ports_list = running_vlan_ports_list(duthosts, rand_one_dut_hostname, rand_selected_dut, tbinfo, ports_list)
count_before = get_fdb_dynamic_mac_count(duthost)
for vlan_port in vlan_ports_list:
port_index = vlan_port["port_index"][0]
for permit_vlanid in map(int, vlan_port["permit_vlanid"]):
Expand All @@ -126,7 +128,14 @@ def test_snmp_fdb_send_tagged(ptfadapter, duthosts, rand_one_dut_hostname,
# Flush dataplane
ptfadapter.dataplane.flush()

time.sleep(20)
pytest_assert(
wait_until(
40, 5, 10,
lambda: (get_fdb_dynamic_mac_count(duthost) - count_before) >= send_cnt
),
"The dummy MACs are not fully populated."
)

hostip = duthost.host.options['inventory_manager'].get_host(
duthost.hostname).vars['ansible_host']
snmp_facts = get_snmp_facts(
Expand Down

0 comments on commit 6917ba3

Please sign in to comment.