Skip to content

Commit 37bc85a

Browse files
committed
Test: Add test case for setting the default settings and check the get ECC state
Related-To: VLCLJ-2434 Signed-off-by: kalyan alle <[email protected]>
1 parent 7e1fe2b commit 37bc85a

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

conformance_tests/sysman/test_sysman_ecc/src/test_sysman_ecc.cpp

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,5 +185,38 @@ LZT_TEST_F(
185185
}
186186
}
187187
}
188-
188+
LZT_TEST_F(
189+
ECC_TEST,
190+
GivenValidDeviceHandleAndECCAvailableWhenEccGetDefaultStateIsQueriedAndSetThenDefaultValuesAreReturnedFromGetEccAPI) {
191+
for (const auto &device : devices) {
192+
// Check if ECC is available and configurable
193+
zes_device_ecc_properties_t getProps = {};
194+
zes_device_ecc_default_properties_ext_t extProps = {};
195+
extProps.stype = ZES_STRUCTURE_TYPE_DEVICE_ECC_DEFAULT_PROPERTIES_EXT;
196+
getProps.pNext = &extProps;
197+
auto available = lzt::get_ecc_available(device);
198+
auto configurable = lzt::get_ecc_configurable(device);
199+
if (available == static_cast<ze_bool_t>(true) &&
200+
configurable == static_cast<ze_bool_t>(true)) {
201+
// Get ECC state with defaults
202+
EXPECT_EQ(ZE_RESULT_SUCCESS, zesDeviceGetEccState(device, &getProps));
203+
zes_device_ecc_state_t defaultState = getProps.currentState;
204+
// Set ECC state with default settings
205+
zes_device_ecc_desc_t newState = {ZES_STRUCTURE_TYPE_DEVICE_ECC_DESC,
206+
nullptr};
207+
newState.state = getProps.currentState;
208+
zes_device_ecc_properties_t setState = {
209+
ZES_STRUCTURE_TYPE_DEVICE_ECC_PROPERTIES, nullptr};
210+
EXPECT_EQ(ZE_RESULT_SUCCESS,
211+
zesDeviceSetEccState(device, &newState, &setState));
212+
// Get ECC state without defaults
213+
EXPECT_EQ(ZE_RESULT_SUCCESS, zesDeviceGetEccState(device, &getProps));
214+
if (getProps.pendingState != getProps.currentState) {
215+
EXPECT_NE(getProps.pendingAction, ZES_DEVICE_ACTION_NONE);
216+
}
217+
} else {
218+
LOG_INFO << "ECC is not available or not configurable";
219+
}
220+
}
221+
}
189222
} // namespace

0 commit comments

Comments
 (0)