Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 13 additions & 3 deletions 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
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", ip_type="ipv4"):
"""
Return a dict of active IP (Ethernet or PortChannel) interfaces, with
Expand All @@ -2415,10 +2425,10 @@ def active_ip_interfaces(self, ip_ifs, tbinfo, ns_arg=DEFAULT_NAMESPACE, intf_nu
"""
active_ip_intf_cnt = 0
mg_facts = self.get_extended_minigraph_facts(tbinfo, ns_arg)
config_facts_ports = self.config_facts(host=self.hostname, source="running")["ansible_facts"].get("PORT", {})
excluded_ports = self.get_backplane_ports()
ip_ifaces = {}
for k, v in list(ip_ifs.items()):
if ((k.startswith("Ethernet") and config_facts_ports.get(k, {}).get("role", "") != "Dpc" and
if ((k.startswith("Ethernet") and (k not in excluded_ports) and
(not k.startswith("Ethernet-BP")) and not is_inband_port(k)) or
(k.startswith("PortChannel") and not self.is_backend_portchannel(k, mg_facts))):
if ip_type == "ipv4":
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 @@ -1002,16 +1002,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
}
bgp_peer_ip_key = "peer_ipv6" if ip_type == "ipv6" else "peer_ipv4"
ip_version = 6 if ip_type == "ipv6" else 4
vlan_info = {}
Expand Down
Loading