Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
12 changes: 11 additions & 1 deletion tests/common/devices/sonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from tests.common import constants

logger = logging.getLogger(__name__)

PROCESS_TO_CONTAINER_MAP = {
"orchagent": "swss",
"syncd": "syncd"
Expand Down Expand Up @@ -2405,6 +2404,17 @@ def is_backend_portchannel(self, port_channel, mg_facts):
def is_backend_port(self, port, mg_facts):
return True if "Ethernet-BP" in port else False

def get_backplane_ports(self):
# get current interface data from config_db.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nnelluri-cisco could you get backplane ports by checking for port "role" in mg_facts? I am assuming after your changes in #20244 you should be able to get that from mg_facts, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nnelluri-cisco Alternatively, you can get that from config_facts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prabhataravind
added required changes

config_facts = self.config_facts(host=self.hostname, source='running', verbose=False)['ansible_facts']
config_db_ports = config_facts["PORT"]
# Build set of Ethernet ports with 18.x.202.0/31 IPs to exclude
excluded_ports = set()
for port, val in config_db_ports.items():
if "role" in val:
excluded_ports.add(port)
return excluded_ports

def active_ip_interfaces(self, ip_ifs, tbinfo, ns_arg=DEFAULT_NAMESPACE, intf_num="all"):
"""
Return a dict of active IP (Ethernet or PortChannel) interfaces, with
Expand Down
23 changes: 15 additions & 8 deletions tests/qos/qos_sai_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,16 +996,23 @@ def dutConfig(
dst_dut = get_src_dst_asic_and_duts['dst_dut']
src_mgFacts = src_dut.get_extended_minigraph_facts(tbinfo)
topo = tbinfo["topo"]["name"]
src_mgFacts['minigraph_ptf_indices'] = {

# Build a set of Ethernet ports to exclude (with 18.x.202.0/31 IPs)
excluded_ports = set()
excluded_ports.update(duthosts[0].get_backplane_ports())
# Filter minigraph_ptf_indices to exclude dynamic ports
src_mgFacts["minigraph_ptf_indices"] = {
key: value
for key, value in src_mgFacts['minigraph_ptf_indices'].items()
if not key.startswith("Ethernet-BP")
}
src_mgFacts['minigraph_ports'] = {
for key, value in src_mgFacts["minigraph_ptf_indices"].items()
if key not in excluded_ports
}

# Filter minigraph_ports to exclude dynamic ports
src_mgFacts["minigraph_ports"] = {
key: value
for key, value in src_mgFacts['minigraph_ports'].items()
if not key.startswith("Ethernet-BP")
}
for key, value in src_mgFacts["minigraph_ports"].items()
if key not in excluded_ports
}

# LAG ports in T1 TOPO need to be removed in Mellanox devices
if topo in self.SUPPORTED_T0_TOPOS or (topo in self.SUPPORTED_PTF_TOPOS and isMellanoxDevice(src_dut)):
Expand Down