@@ -1127,7 +1127,7 @@ class NicType(Enum):
1127
1127
1128
1128
1129
1129
# Short name for nic types
1130
- NIC_SHORT_NAMES = {
1130
+ NIC_SHORT_NAMES : Dict [ NicType , str ] = {
1131
1131
NicType .CX3 : "cx3" ,
1132
1132
NicType .CX4 : "cx4" ,
1133
1133
NicType .CX5 : "cx5" ,
@@ -1150,13 +1150,12 @@ def get_node_nic_short_name(node: Node) -> str:
1150
1150
short_names = map (lambda x : x .value , non_mana_nics )
1151
1151
known_nic_types = "," .join (short_names )
1152
1152
found_nic_types = "," .join (map (str , [x .device_id for x in devices ]))
1153
- node .log .debug (
1153
+ # assert, this will be caught in annotate_dpdk_test_result
1154
+ # and logged, rather than failing the test.
1155
+ raise AssertionError (
1154
1156
"Unknown NIC hardware was detected during DPDK test case. "
1155
1157
f"Expected one of: { known_nic_types } . Found { found_nic_types } . "
1156
1158
)
1157
- # this is just a function for annotating a result, so don't assert
1158
- # if there's
1159
- return found_nic_types
1160
1159
1161
1160
1162
1161
def _format_version_str (version : VersionInfo ) -> str :
@@ -1178,19 +1177,19 @@ def annotate_dpdk_test_result(
1178
1177
test_result .information ["dpdk_version" ] = _format_version_str (dpdk_version )
1179
1178
log .debug (f"Adding dpdk version: { dpdk_version } " )
1180
1179
except AssertionError as err :
1181
- test_kit . node . log .debug (f"Could not fetch DPDK version info: { str (err )} " )
1180
+ log .debug (f"Could not fetch DPDK version info: { str (err )} " )
1182
1181
try :
1183
1182
rdma_version = test_kit .rdma_core .get_installed_version ()
1184
1183
test_result .information ["rdma_version" ] = _format_version_str (rdma_version )
1185
1184
log .debug (f"Adding rdma version: { rdma_version } " )
1186
1185
except AssertionError as err :
1187
- test_kit . node . log .debug (f"Could not fetch RDMA version info: { str (err )} " )
1186
+ log .debug (f"Could not fetch RDMA version info: { str (err )} " )
1188
1187
try :
1189
1188
nic_hw = get_node_nic_short_name (test_kit .node )
1190
1189
test_result .information ["nic_hw" ] = nic_hw
1191
1190
log .debug (f"Adding nic version: { nic_hw } " )
1192
1191
except AssertionError as err :
1193
- test_kit . node . log .debug (f"Could not fetch NIC short name: { str (err )} " )
1192
+ log .debug (f"Could not fetch NIC short name: { str (err )} " )
1194
1193
1195
1194
1196
1195
def skip_32bit_test_on_unsupported_distros (os : OperatingSystem ) -> None :
0 commit comments