Skip to content

Commit e3bacc9

Browse files
nikamirrrvidyac86
authored andcommitted
Use config_facts to exclude the DPU (role=Dpc) ports from the ipfwd/test_nhop_group.py tests (sonic-net#20668)
1 parent cfb01fc commit e3bacc9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/common/devices/sonic.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,11 +2415,12 @@ def active_ip_interfaces(self, ip_ifs, tbinfo, ns_arg=DEFAULT_NAMESPACE, intf_nu
24152415
"""
24162416
active_ip_intf_cnt = 0
24172417
mg_facts = self.get_extended_minigraph_facts(tbinfo, ns_arg)
2418+
config_facts_ports = self.config_facts(host=self.hostname, source="running")["ansible_facts"].get("PORT", {})
24182419
ip_ifaces = {}
24192420
for k, v in list(ip_ifs.items()):
2420-
if ((k.startswith("Ethernet") and (not k.startswith("Ethernet-BP")) and not is_inband_port(k)) or
2421-
(k.startswith("PortChannel") and not
2422-
self.is_backend_portchannel(k, mg_facts))):
2421+
if ((k.startswith("Ethernet") and config_facts_ports.get(k, {}).get("role", "") != "Dpc" and
2422+
(not k.startswith("Ethernet-BP")) and not is_inband_port(k)) or
2423+
(k.startswith("PortChannel") and not self.is_backend_portchannel(k, mg_facts))):
24232424
# Ping for some time to get ARP Re-learnt.
24242425
# We might have to tune it further if needed.
24252426
if (v["admin"] == "up" and v["oper_state"] == "up" and

0 commit comments

Comments
 (0)