Skip to content

Commit 6c5cf08

Browse files
committed
Implement CTS for zesFabricPortGetFabricErrorCounters
Related-To: VLCLJ-2240
1 parent 50a37fa commit 6c5cf08

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

conformance_tests/sysman/test_sysman_fabric/src/test_sysman_fabric.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,25 @@ TEST_F(
343343
}
344344
}
345345

346+
TEST_F(
347+
FABRICPORT_TEST,
348+
GivenValidFabricPortHandleWhenRetrievingFabricPortErrorCountersThenValidCounterValuesAreReturned) {
349+
for (auto device : devices) {
350+
uint32_t count = 0;
351+
auto fabric_port_handles = lzt::get_fabric_port_handles(device, count);
352+
if (count == 0) {
353+
FAIL() << "No handles found: "
354+
<< _ze_result_t(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
355+
}
356+
for (auto fabric_port_handle : fabric_port_handles) {
357+
ASSERT_NE(nullptr, fabric_port_handle);
358+
auto fabric_port_error_counters =
359+
lzt::get_fabric_port_error_counters(fabric_port_handle);
360+
EXPECT_LT(fabric_port_error_counters.linkFailureCount, UINT64_MAX);
361+
EXPECT_LT(fabric_port_error_counters.fwCommErrorCount, UINT64_MAX);
362+
EXPECT_LT(fabric_port_error_counters.fwErrorCount, UINT64_MAX);
363+
EXPECT_LT(fabric_port_error_counters.linkDegradeCount, UINT64_MAX);
364+
}
365+
}
366+
}
346367
} // namespace

utils/test_harness/sysman/include/test_harness_sysman_fabric.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ get_fabric_port_throughput(zes_fabric_port_handle_t fabricPortHandle);
3737
zes_fabric_link_type_t
3838
get_fabric_port_link(zes_fabric_port_handle_t fabricPortHandle);
3939

40+
zes_fabric_port_error_counters_t
41+
get_fabric_port_error_counters(zes_fabric_port_handle_t fabric_port_handle);
42+
4043
} // namespace level_zero_tests
4144

4245
#endif

utils/test_harness/sysman/src/test_harness_sysman_fabric.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,12 @@ get_fabric_port_link(zes_fabric_port_handle_t fabric_port_handle) {
8585
return link;
8686
}
8787

88+
zes_fabric_port_error_counters_t
89+
get_fabric_port_error_counters(zes_fabric_port_handle_t fabric_port_handle) {
90+
zes_fabric_port_error_counters_t counters = {};
91+
EXPECT_EQ(ZE_RESULT_SUCCESS,
92+
zesFabricPortGetFabricErrorCounters(fabric_port_handle, &counters));
93+
return counters;
94+
}
95+
8896
} // namespace level_zero_tests

0 commit comments

Comments
 (0)