if (!isChecked)
{
int ret = system_info_get_platform_bool("tizen.org/feature/security.tee", &isEnabled);
- RUNNER_ASSERT_MSG(ret == SYSTEM_INFO_ERROR_NONE,
- "Failed to get system info. Error: " << systemInfoErrToString(ret));
+ if (ret == SYSTEM_INFO_ERROR_INVALID_PARAMETER)
+ {
+ // device may be so old it does not have the security.tee setting in config at all
+ isEnabled = false;
+ } else {
+ RUNNER_ASSERT_MSG(ret == SYSTEM_INFO_ERROR_NONE,
+ "Failed to get system info. Error: " << systemInfoErrToString(ret));
+ }
isChecked = true;
}
return isEnabled;
RUNNER_CHILD_TEST(libteec_01_load_TA_as_app)
{
- Ta ta(taUuid);
+ auto taPtr = std::unique_ptr<Ta>(nullptr);
TemporaryTestUser tmpUser("libteec_01_test_user", GUM_USERTYPE_NORMAL);
tmpUser.create();
bool isTeeEnabled = checkIfTeeEnabled();
+ if (isTeeEnabled)
+ {
+ taPtr.reset(new Ta(taUuid));
+ }
+
auto fun = [&]()
{
auto contextPtr = std::unique_ptr<TEEC_Context, decltype(&TEEC_FinalizeContext)>
TEEC_Result res = TEEC_InitializeContext(NULL, &context);
contextPtr.reset(&context);
- TEEC_Result desiredResult = isTeeEnabled ? TEEC_SUCCESS : TEEC_ERROR_NOT_SUPPORTED;
+ TEEC_Result desiredResult = isTeeEnabled ? TEEC_SUCCESS : TEEC_ERROR_NOT_IMPLEMENTED;
RUNNER_ASSERT_MSG(res == desiredResult,
"Failed to initialize context. Error code: " << errToString(res)
<< ", expected: " << errToString(desiredResult));
&session, &taUuid, TEEC_LOGIN_PUBLIC, NULL, NULL, &returnOrigin);
sessionPtr.reset(&session);
- desiredResult = isTeeEnabled ? TEEC_SUCCESS : TEEC_ERROR_NOT_SUPPORTED;
+ desiredResult = isTeeEnabled ? TEEC_SUCCESS : TEEC_ERROR_NOT_IMPLEMENTED;
RUNNER_ASSERT_MSG(res == desiredResult,
"Opening libteec session returned wrong value: " << errToString(res)
<< ", expected: " << errToString(desiredResult));
RUNNER_CHILD_TEST(libteec_02_load_TA_as_system)
{
- Ta ta(taUuid);
+ auto taPtr = std::unique_ptr<Ta>(nullptr);
bool isTeeEnabled = checkIfTeeEnabled();
+ if (isTeeEnabled)
+ {
+ taPtr.reset(new Ta(taUuid));
+ }
+
auto fun = [&]()
{
auto contextPtr = std::unique_ptr<TEEC_Context, decltype(&TEEC_FinalizeContext)>
TEEC_Result res = TEEC_InitializeContext(NULL, &context);
contextPtr.reset(&context);
- TEEC_Result desiredResult = isTeeEnabled ? TEEC_SUCCESS : TEEC_ERROR_NOT_SUPPORTED;
+ TEEC_Result desiredResult = isTeeEnabled ? TEEC_SUCCESS : TEEC_ERROR_NOT_IMPLEMENTED;
RUNNER_ASSERT_MSG(res == desiredResult,
"Failed to initialize context. Error code: " << errToString(res)
<< ", expected: " << errToString(desiredResult));
&session, &taUuid, TEEC_LOGIN_PUBLIC, NULL, NULL, &returnOrigin);
sessionPtr.reset(&session);
- desiredResult = isTeeEnabled ? TEEC_SUCCESS : TEEC_ERROR_NOT_SUPPORTED;
+ desiredResult = isTeeEnabled ? TEEC_SUCCESS : TEEC_ERROR_NOT_IMPLEMENTED;
RUNNER_ASSERT_MSG(res == desiredResult,
"Opening libteec session returned wrong value: " << errToString(res)
<< ", expected: " << errToString(desiredResult));
contextPtr.reset(&context);
// OpTEE return TEEC_ERROR_ITEM_NOT_FOUND, when cannot access to /dev/tee
- TEEC_Result desiredResult = isTeeEnabled ? TEEC_ERROR_ACCESS_DENIED : TEEC_ERROR_NOT_SUPPORTED;
+ TEEC_Result desiredResult = isTeeEnabled ? TEEC_ERROR_ACCESS_DENIED : TEEC_ERROR_NOT_IMPLEMENTED;
RUNNER_ASSERT_MSG(res == desiredResult,
"Initializing context returned wrong error code: " << errToString(res)
<< ", expected: " << errToString(desiredResult));
TEEC_Result res = TEEC_InitializeContext("Invalid context name", &context);
contextPtr.reset(&context);
- TEEC_Result desiredResult = isTeeEnabled ? TEEC_ERROR_ITEM_NOT_FOUND : TEEC_ERROR_NOT_SUPPORTED;
+ TEEC_Result desiredResult = isTeeEnabled ? TEEC_ERROR_ITEM_NOT_FOUND : TEEC_ERROR_NOT_IMPLEMENTED;
RUNNER_ASSERT_MSG(res == desiredResult,
"Initializing context returned wrong error code: " << errToString(res)
<< ", expected: " << errToString(desiredResult));