Skip to content

Commit 1ebad8c

Browse files
committed
Add Test for Validating ECC Default State Values
Related-To: VLCLJ-2433 The test ensures that the ECC state retrieval API returns valid values when ECC is available on a valid device handle Signed-off-by: Alle, Kalyan <[email protected]>
1 parent a0e59be commit 1ebad8c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

conformance_tests/sysman/test_sysman_ecc/src/test_sysman_ecc.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,37 @@ LZT_TEST_F(
186186
}
187187
}
188188

189+
LZT_TEST_F(
190+
ECC_TEST,
191+
GIvenValidDeviceHandleWhenEccGetDefaultStateIsQueriedThenValidValuesAreReturned) {
192+
for (const auto &device : devices) {
193+
auto available = lzt::get_ecc_available(device);
194+
auto configurable = lzt::get_ecc_configurable(device);
195+
if (available == static_cast<ze_bool_t>(true) &&
196+
configurable == static_cast<ze_bool_t>(true)) {
197+
// Get ECC state WITH default state extension
198+
zes_device_ecc_default_properties_ext_t defaultExt = {
199+
ZES_STRUCTURE_TYPE_DEVICE_ECC_DEFAULT_PROPERTIES_EXT, nullptr};
200+
zes_device_ecc_properties_t eccState = {
201+
ZES_STRUCTURE_TYPE_DEVICE_ECC_PROPERTIES, &defaultExt};
202+
203+
EXPECT_ZE_RESULT_SUCCESS(zesDeviceGetEccState(device, &eccState));
204+
205+
// Validate regular state values
206+
EXPECT_GE(eccState.currentState, ZES_DEVICE_ECC_STATE_UNAVAILABLE);
207+
EXPECT_LE(eccState.currentState, ZES_DEVICE_ECC_STATE_DISABLED);
208+
EXPECT_GE(eccState.pendingState, ZES_DEVICE_ECC_STATE_UNAVAILABLE);
209+
EXPECT_LE(eccState.pendingState, ZES_DEVICE_ECC_STATE_DISABLED);
210+
EXPECT_GE(eccState.pendingAction, ZES_DEVICE_ACTION_NONE);
211+
EXPECT_LE(eccState.pendingAction, ZES_DEVICE_ACTION_COLD_SYSTEM_REBOOT);
212+
213+
// Validate default state value
214+
EXPECT_GE(defaultExt.defaultState, ZES_DEVICE_ECC_STATE_UNAVAILABLE);
215+
EXPECT_LE(defaultExt.defaultState, ZES_DEVICE_ECC_STATE_DISABLED);
216+
} else {
217+
LOG_INFO << "ECC is not available or not configurable";
218+
}
219+
}
220+
}
221+
189222
} // namespace

0 commit comments

Comments
 (0)