From f798f140a3bcf454717f8b91390ab34bd2934c6e Mon Sep 17 00:00:00 2001 From: Matthew G McGovern Date: Wed, 30 Oct 2024 12:29:17 -0700 Subject: [PATCH] Dpdk: fix device_id -> device_info --- microsoft/testsuites/dpdk/dpdkutil.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/microsoft/testsuites/dpdk/dpdkutil.py b/microsoft/testsuites/dpdk/dpdkutil.py index c398821b30..5c9f312c93 100644 --- a/microsoft/testsuites/dpdk/dpdkutil.py +++ b/microsoft/testsuites/dpdk/dpdkutil.py @@ -1139,15 +1139,14 @@ def get_node_nic_short_name(node: Node) -> str: devices = node.tools[Lspci].get_devices_by_type(DEVICE_TYPE_SRIOV) if node.nics.is_mana_device_present(): return NIC_SHORT_NAMES[NicType.MANA] - for nic_name in [NicType.CX3, NicType.CX4, NicType.CX5]: - if any([str(nic_name) in x.device_id for x in devices]): + short_names = map(lambda x: x.value, [NicType.CX3, NicType.CX4, NicType.CX5]) + for nic_name in short_names: + if any([str(nic_name) in x.device_info for x in devices]): return NIC_SHORT_NAMES[nic_name] # We assert much earlier to enforce that SRIOV is enabled, # so we should never hit this unless someone is testing a new platform. # Instead of asserting, just log that the short name was not found. - known_nic_types = ",".join( - map(str, [NicType.CX3, NicType.CX4, NicType.CX5, NicType.MANA]) - ) + known_nic_types = ",".join(short_names) found_nic_types = ",".join(map(str, [x.device_id for x in devices])) node.log.debug( "Unknown NIC hardware was detected during DPDK test case. "