diff --git a/tests/acl/test_acl.py b/tests/acl/test_acl.py index aac7acd8d93..4377514f155 100644 --- a/tests/acl/test_acl.py +++ b/tests/acl/test_acl.py @@ -9,6 +9,7 @@ import ptf.testutils as testutils import ptf.mask as mask import ptf.packet as packet +import re from abc import ABCMeta, abstractmethod from collections import defaultdict @@ -423,11 +424,18 @@ def setup(duthosts, ptfhost, rand_selected_dut, rand_selected_front_end_dut, ran # In multi-asic we need config both in host and namespace. if namespace: acl_table_ports[''] += port - if len(port_channels) and topo in ["t0", "m0_vlan", "m0_l3"] or tbinfo["topo"]["name"] in ("t1-lag", "t1-64-lag", - "t1-64-lag-clet", - "t1-56-lag", - "t1-28-lag", - "t1-32-lag"): + if ( + len(port_channels) + and ( + topo in ["t0", "m0_vlan", "m0_l3"] + or tbinfo["topo"]["name"] in ( + "t1-lag", "t1-64-lag", "t1-64-lag-clet", + "t1-56-lag", "t1-28-lag", "t1-32-lag" + ) + or 't1-isolated' in tbinfo["topo"]["name"] + ) + and not re.match(r"t0-.*s\d+", tbinfo["topo"]["name"]) + ): for k, v in list(port_channels.items()): acl_table_ports[v['namespace']].append(k) diff --git a/tests/acl/test_stress_acl.py b/tests/acl/test_stress_acl.py index f4e58aebab4..24a5b7e504b 100644 --- a/tests/acl/test_stress_acl.py +++ b/tests/acl/test_stress_acl.py @@ -193,7 +193,8 @@ def prepare_test_port(rand_selected_dut, tbinfo): upstream_port_neighbor_ips = {} for interface, neighbor in list(mg_facts["minigraph_neighbors"].items()): port_id = mg_facts["minigraph_ptf_indices"][interface] - if (topo == "t1" and "T2" in neighbor["name"]) or (topo == "t0" and "T1" in neighbor["name"]) or \ + if (topo == "t1" and "T2" in neighbor["name"]) or \ + (topo == "t0" and ("T1" in neighbor["name"] or "PT0" in neighbor["name"])) or \ (topo == "m0" and "M1" in neighbor["name"]) or (topo == "mx" and "M0" in neighbor["name"]) or \ (topo_name in ("t1-isolated-d32", "t1-isolated-d128") and "T0" in neighbor["name"]): upstream_ports[neighbor['namespace']].append(interface) diff --git a/tests/common/helpers/constants.py b/tests/common/helpers/constants.py index f6e04273086..9cc32454d81 100644 --- a/tests/common/helpers/constants.py +++ b/tests/common/helpers/constants.py @@ -23,7 +23,7 @@ # Describe ALL upstream neighbor of dut in different topos UPSTREAM_ALL_NEIGHBOR_MAP = { - "t0": ["t1"], + "t0": ["t1", "pt0"], "t1": ["t2"], "m1": ["ma", "mb"], "m0": ["m1"], diff --git a/tests/common/helpers/ptf_tests_helper.py b/tests/common/helpers/ptf_tests_helper.py index 4b3f6486895..6743d8884fe 100644 --- a/tests/common/helpers/ptf_tests_helper.py +++ b/tests/common/helpers/ptf_tests_helper.py @@ -57,7 +57,7 @@ def upstream_links(rand_selected_dut, tbinfo, nbrhosts): duthost = rand_selected_dut def filter(interface, neighbor, mg_facts, tbinfo): - if ((tbinfo["topo"]["type"] == "t0" and "T1" in neighbor["name"]) + if ((tbinfo["topo"]["type"] == "t0" and ("T1" in neighbor["name"] or "PT0" in neighbor["name"])) or (tbinfo["topo"]["type"] == "t1" and "T2" in neighbor["name"])): local_ipv4_addr = None peer_ipv4_addr = None