Skip to content

Commit

Permalink
regression 1040: test interrupt notification
Browse files Browse the repository at this point in the history
Adds regression test 1040 to invoke a new Invoke test PTA command that
triggers interrupt notification tests. When the command is not supported
or Invoke test PTA not embedded, the test is skipped.

Signed-off-by: Etienne Carriere <[email protected]>
  • Loading branch information
etienne-lms committed Apr 3, 2023
1 parent fec6bea commit 2deb45c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions host/xtest/regression_1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -3272,3 +3272,37 @@ static void xtest_tee_test_1039(ADBG_Case_t *c)

ADBG_CASE_DEFINE(regression, 1039, xtest_tee_test_1039,
"Test subkey verification");

static void xtest_tee_test_1040(ADBG_Case_t *c)
{
TEEC_Result res = TEEC_ERROR_GENERIC;
TEEC_Session session = { };
uint32_t ret_orig = 0;

res = xtest_teec_open_session(&session, &pta_invoke_tests_ta_uuid, NULL,
&ret_orig);
if (res == TEEC_ERROR_ITEM_NOT_FOUND) {
/* Pseudo TA is optional: warn and nicely exit */
Do_ADBG_Log(" - 1040 - skip test, pseudo TA not found");
return;
}
ADBG_EXPECT_TEEC_SUCCESS(c, res);

res = TEEC_InvokeCommand(&session, PTA_INVOKE_TESTS_CMD_ITR_NOTIF_TESTS,
NULL, &ret_orig);
if (res != TEEC_SUCCESS) {
ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, TEEC_ORIGIN_TRUSTED_APP,
ret_orig);
if (res == TEEC_ERROR_NOT_SUPPORTED) {
/* Embedding tests is optional: warn and nicely exit */
Do_ADBG_Log(" - 1040 - skip test, not implemented");
goto out;
}
/* Error */
ADBG_EXPECT_TEEC_SUCCESS(c, res);
}
out:
TEEC_CloseSession(&session);
}
ADBG_CASE_DEFINE(regression, 1040, xtest_tee_test_1040,
"Test interrupt notification to normal world");

0 comments on commit 2deb45c

Please sign in to comment.