24 #ifdef TFM_IPC_ISOLATION_2_TEST_READ_ONLY_MEM
28 #ifdef TFM_IPC_ISOLATION_2_APP_ACCESS_PSA_MEM
32 #ifdef TFM_IPC_ISOLATION_2_MEM_CHECK
38 static struct test_t ipc_veneers_tests[] = {
39 {&tfm_ipc_test_1001,
"TFM_IPC_TEST_1001",
41 {&tfm_ipc_test_1002,
"TFM_IPC_TEST_1002",
43 {&tfm_ipc_test_1003,
"TFM_IPC_TEST_1003",
45 {&tfm_ipc_test_1004,
"TFM_IPC_TEST_1004",
47 {&tfm_ipc_test_1005,
"TFM_IPC_TEST_1005",
49 {&tfm_ipc_test_1006,
"TFM_IPC_TEST_1006",
50 "Call PSA RoT access APP RoT memory test service", {
TEST_PASSED}},
51 #ifdef TFM_IPC_ISOLATION_2_TEST_READ_ONLY_MEM
52 {&tfm_ipc_test_1007,
"TFM_IPC_TEST_1007",
53 "Call PSA RoT access APP RoT readonly memory test service", {
TEST_PASSED}},
55 #ifdef TFM_IPC_ISOLATION_2_APP_ACCESS_PSA_MEM
56 {&tfm_ipc_test_1008,
"TFM_IPC_TEST_1008",
57 "Call APP RoT access PSA RoT memory test service", {
TEST_PASSED}},
59 #ifdef TFM_IPC_ISOLATION_2_MEM_CHECK
60 {&tfm_ipc_test_1009,
"TFM_IPC_TEST_1009",
61 "Call APP RoT memory check test service", {
TEST_PASSED}},
63 {&tfm_ipc_test_1010,
"TFM_IPC_TEST_1010",
64 "Test psa_call with the status of PSA_ERROR_PROGRAMMER_ERROR", {
TEST_PASSED}},
71 list_size = (
sizeof(ipc_veneers_tests) /
sizeof(ipc_veneers_tests[0]));
73 set_testsuite(
"IPC non-secure interface test (TFM_IPC_TEST_1XXX)",
74 ipc_veneers_tests, list_size, p_test_suite);
90 TEST_LOG(
"The version of the PSA Framework API is %d.\r\n", version);
92 TEST_FAIL(
"The version of the PSA Framework API is not valid!\r\n");
106 TEST_FAIL(
"RoT Service is not implemented or caller is not authorized" \
107 "to access it!\r\n");
111 TEST_LOG(
"The service version is %d.\r\n", version);
128 TEST_FAIL(
"The RoT Service has refused the connection!\r\n");
140 char str1[] =
"str1";
141 char str2[] =
"str2";
142 char str3[128], str4[128];
143 struct psa_invec invecs[2] = {{str1,
sizeof(str1)/
sizeof(
char)},
144 {str2,
sizeof(str2)/
sizeof(
char)}};
145 struct psa_outvec outvecs[2] = {{str3,
sizeof(str3)/
sizeof(
char)},
146 {str4,
sizeof(str4)/
sizeof(
char)}};
152 TEST_LOG(
"TFM service support version is %d.\r\n", version);
157 TEST_LOG(
"psa_call is successful!\r\n");
177 struct psa_outvec outvecs[1] = {{&test_result,
sizeof(test_result)}};
184 TEST_LOG(
"The RoT Service has refused the connection!\r\n");
192 if (test_result > 0) {
214 struct psa_outvec outvecs[1] = {{&test_result,
sizeof(test_result)}};
221 TEST_LOG(
"The RoT Service has refused the connection!\r\n");
229 if (test_result > 0) {
242 #ifdef TFM_IPC_ISOLATION_2_TEST_READ_ONLY_MEM
251 struct psa_outvec outvecs[1] = {{&test_result,
sizeof(test_result)}};
258 TEST_LOG(
"The RoT Service has refused the connection!\r\n");
271 #ifdef TFM_IPC_ISOLATION_2_APP_ACCESS_PSA_MEM
280 struct psa_outvec outvecs[1] = {{&test_result,
sizeof(test_result)}};
287 TEST_LOG(
"The RoT Service has refused the connection!\r\n");
300 #ifdef TFM_IPC_ISOLATION_2_MEM_CHECK
309 struct psa_outvec outvecs[1] = {{&test_result,
sizeof(test_result)}};
316 TEST_LOG(
"The RoT Service has refused the connection!\r\n");
342 TEST_LOG(
"The RoT Service has refused the connection!\r\n");
348 TEST_LOG(
"The first time call success!\r\n");
350 TEST_LOG(
"The first time call failed!\r\n");
355 TEST_LOG(
"The second time call success!\r\n");
357 TEST_LOG(
"The second time call failed!\r\n");
#define PSA_FRAMEWORK_VERSION
#define IPC_CLIENT_TEST_APP_ACCESS_PSA_MEM_VERSION
#define TEST_FAIL(info_msg)
#define IPC_SERVICE_TEST_CLIENT_PROGRAMMER_ERROR_VERSION
enum test_suite_err_t set_testsuite(const char *name, struct test_t *test_list, uint32_t size, struct test_suite_t *p_ts)
Sets test suite parameters.
#define IPC_CLIENT_TEST_APP_ACCESS_PSA_MEM_SID
void psa_close(psa_handle_t handle)
Close a connection to an RoT Service.
#define IPC_CLIENT_TEST_BASIC_SID
#define IPC_CLIENT_TEST_BASIC_VERSION
uint32_t psa_framework_version(void)
Retrieve the version of the PSA Framework API that is implemented.
#define IPC_CLIENT_TEST_PSA_ACCESS_APP_MEM_SID
#define IPC_CLIENT_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_VERSION
psa_handle_t psa_connect(uint32_t sid, uint32_t version)
Connect to an RoT Service by its SID.
#define IPC_CLIENT_TEST_MEM_CHECK_SID
#define IPC_CLIENT_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SID
#define PSA_ERROR_PROGRAMMER_ERROR
void register_testsuite_ns_ipc_interface(struct test_suite_t *p_test_suite)
Register testsuite for ipc non-secure interface.
#define IPC_SERVICE_TEST_BASIC_SID
uint32_t psa_version(uint32_t sid)
Retrieve the version of an RoT Service or indicate that it is not present on this system...
#define IPC_SERVICE_TEST_BASIC_VERSION
#define IPC_CLIENT_TEST_MEM_CHECK_VERSION
int32_t psa_status_t
Function return status.
#define IPC_SERVICE_TEST_CLIENT_PROGRAMMER_ERROR_SID
psa_status_t psa_call(psa_handle_t handle, int32_t type, const psa_invec *in_vec, size_t in_len, psa_outvec *out_vec, size_t out_len)
Call an RoT Service on an established connection.
#define IPC_CLIENT_TEST_PSA_ACCESS_APP_MEM_VERSION