@@ -518,7 +518,8 @@ def verify_dpdk_build(
518
518
except (NotEnoughMemoryException , UnsupportedOperationException ) as err :
519
519
raise SkippedException (err )
520
520
testpmd = test_kit .testpmd
521
-
521
+ if result is not None :
522
+ annotate_dpdk_test_result (test_kit , test_result = result , log = log )
522
523
# grab a nic and run testpmd
523
524
test_nic = node .nics .get_secondary_nic ()
524
525
@@ -534,8 +535,7 @@ def verify_dpdk_build(
534
535
assert_that (tx_pps ).described_as (
535
536
f"TX-PPS ({ tx_pps } ) should have been greater than 2^20 (~1m) PPS."
536
537
).is_greater_than (2 ** 20 )
537
- if result is not None :
538
- annotate_dpdk_test_result (test_kit , test_result = result , log = log )
538
+
539
539
return test_kit
540
540
541
541
@@ -1126,7 +1126,7 @@ class NicType(Enum):
1126
1126
1127
1127
1128
1128
# Short name for nic types
1129
- NIC_SHORT_NAMES = {
1129
+ NIC_SHORT_NAMES : Dict [ NicType , str ] = {
1130
1130
NicType .CX3 : "cx3" ,
1131
1131
NicType .CX4 : "cx4" ,
1132
1132
NicType .CX5 : "cx5" ,
@@ -1139,22 +1139,21 @@ def get_node_nic_short_name(node: Node) -> str:
1139
1139
devices = node .tools [Lspci ].get_devices_by_type (DEVICE_TYPE_SRIOV )
1140
1140
if node .nics .is_mana_device_present ():
1141
1141
return NIC_SHORT_NAMES [NicType .MANA ]
1142
- short_names = map ( lambda x : x . value , [NicType .CX3 , NicType .CX4 , NicType .CX5 ])
1143
- for nic_name in short_names :
1144
- if any ([str ( nic_name ) in x .device_info for x in devices ]):
1142
+ mlx_nics = [NicType .CX3 , NicType .CX4 , NicType .CX5 ]
1143
+ for nic_name in mlx_nics :
1144
+ if any ([nic_name . value in x .device_info for x in devices ]):
1145
1145
return NIC_SHORT_NAMES [nic_name ]
1146
1146
# We assert much earlier to enforce that SRIOV is enabled,
1147
1147
# so we should never hit this unless someone is testing a new platform.
1148
1148
# Instead of asserting, just log that the short name was not found.
1149
- known_nic_types = "," .join (short_names )
1149
+ known_nic_types = "," .join ([ x . value for x in mlx_nics ] )
1150
1150
found_nic_types = "," .join (map (str , [x .device_id for x in devices ]))
1151
- node .log .debug (
1151
+ # assert, this will be caught in annotate_dpdk_test_result
1152
+ # and logged, rather than failing the test.
1153
+ raise AssertionError (
1152
1154
"Unknown NIC hardware was detected during DPDK test case. "
1153
1155
f"Expected one of: { known_nic_types } . Found { found_nic_types } . "
1154
1156
)
1155
- # this is just a function for annotating a result, so don't assert
1156
- # if there's
1157
- return found_nic_types
1158
1157
1159
1158
1160
1159
# Add dpdk/rdma/nic info to dpdk test result
@@ -1170,19 +1169,19 @@ def annotate_dpdk_test_result(
1170
1169
test_result .information ["dpdk_version" ] = str (dpdk_version )
1171
1170
log .debug (f"Found dpdk version: { dpdk_version } " )
1172
1171
except AssertionError as err :
1173
- test_kit . node . log .debug (f"Could not fetch DPDK version info: { str (err )} " )
1172
+ log .debug (f"Could not fetch DPDK version info: { str (err )} " )
1174
1173
try :
1175
1174
rdma_version = test_kit .rdma_core .get_installed_version ()
1176
1175
test_result .information ["rdma_version" ] = str (rdma_version )
1177
1176
log .debug (f"Found rdma version: { rdma_version } " )
1178
1177
except AssertionError as err :
1179
- test_kit . node . log .debug (f"Could not fetch RDMA version info: { str (err )} " )
1178
+ log .debug (f"Could not fetch RDMA version info: { str (err )} " )
1180
1179
try :
1181
1180
nic_hw = get_node_nic_short_name (test_kit .node )
1182
1181
test_result .information ["nic_hw" ] = nic_hw
1183
1182
log .debug (f"Found nic version: { nic_hw } " )
1184
1183
except AssertionError as err :
1185
- test_kit . node . log .debug (f"Could not fetch NIC short name: { str (err )} " )
1184
+ log .debug (f"Could not fetch NIC short name: { str (err )} " )
1186
1185
1187
1186
1188
1187
def skip_32bit_test_on_unsupported_distros (os : OperatingSystem ) -> None :
0 commit comments