12 #include "../its_tests_common.h"
16 #define TEST_UID_ACCESS_CONTROL 42U
24 static struct test_t psa_its_s_tests[] = {
28 "Set interface with create flags"},
30 "Set interface with NULL data pointer"},
32 "Set interface with write once UID"},
34 "Get interface with valid data"},
36 "Get interface with zero data length"},
38 "Get interface with invalid UIDs"},
40 "Get interface with data lengths and offsets greater than UID length"},
42 "Get interface with NULL data pointer"},
44 "Get info interface with write once UID"},
46 "Get info interface with valid UID"},
48 "Get info interface with invalid UIDs"},
50 "Remove interface with valid UID"},
52 "Remove interface with write once UID"},
54 "Remove interface with invalid UID"},
56 "Block compaction after remove"},
58 "Multiple partial gets"},
60 "Multiple sets to same UID from same thread"},
62 "Set, get and remove interface with different asset sizes"},
63 {&tfm_its_test_2020,
"TFM_ITS_TEST_2020",
64 "Set interface with invalid data length"},
65 {&tfm_its_test_2021,
"TFM_ITS_TEST_2021",
66 "Get interface with invalid data lengths and offsets"},
67 {&tfm_its_test_2022,
"TFM_ITS_TEST_2022",
68 "Get info interface with NULL info pointer"},
69 {&tfm_its_test_2023,
"TFM_ITS_TEST_2023",
70 "Attempt to get a UID set by a different partition"},
77 list_size = (
sizeof(psa_its_s_tests) /
sizeof(psa_its_s_tests[0]));
79 set_testsuite(
"PSA internal trusted storage S interface tests "
80 "(TFM_ITS_TEST_2XXX)",
81 psa_its_s_tests, list_size, p_test_suite);
107 status =
psa_its_set(uid, data_len, write_data, flags);
109 TEST_FAIL(
"Set should not succeed with invalid data length");
135 size_t read_data_length = 0;
137 status =
psa_its_set(uid, write_len, write_data, flags);
157 TEST_FAIL(
"Get should not succeed with invalid arguments");
163 TEST_FAIL(
"Read data should be equal to original read data");
173 TEST_FAIL(
"Get should not succeed with invalid arguments");
179 TEST_FAIL(
"Read data should be equal to original read data");
186 TEST_FAIL(
"Remove should not fail with valid UID");
208 status =
psa_its_set(uid, data_len, write_data, flags);
224 TEST_FAIL(
"Get info should not succeed with NULL info pointer");
232 TEST_FAIL(
"Remove should not fail with valid UID");
262 TEST_FAIL(
"Get should not succeed from a different partition");
269 TEST_FAIL(
"Remove should not fail with valid UID");
void tfm_its_test_common_019(struct test_result_t *ret)
Tests set, get_info, get and remove function with:
psa_status_t tfm_secure_client_2_call_test(int32_t id, const void *arg, size_t arg_len)
Calls the test function with the supplied ID within the execution context of the Secure Client 2 part...
#define TEST_FAIL(info_msg)
void tfm_its_test_common_016(struct test_result_t *ret)
Tests data block compact feature. Set UID 1 to locate it at the beginning of the block. Then set UID 2 to be located after UID 1 and remove UID 1. UID 2 will be compacted to the beginning of the block. This test verifies that the compaction works correctly by reading back UID 2.
void tfm_its_test_common_007(struct test_result_t *ret)
Tests get function with:
void tfm_its_test_common_012(struct test_result_t *ret)
Tests get info function with:
void tfm_its_test_common_010(struct test_result_t *ret)
Tests get info function with:
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.
void tfm_its_test_common_002(struct test_result_t *ret)
Tests set function with:
void tfm_its_test_common_017(struct test_result_t *ret)
Tests set and multiple partial gets.
psa_status_t psa_its_get_info(psa_storage_uid_t uid, struct psa_storage_info_t *p_info)
Retrieve the metadata about the provided uid.
void tfm_its_test_common_011(struct test_result_t *ret)
Tests get info function with:
void register_testsuite_s_psa_its_interface(struct test_suite_t *p_test_suite)
Register testsuite for the PSA internal trusted storage S interface tests.
psa_status_t psa_its_get(psa_storage_uid_t uid, size_t data_offset, size_t data_size, void *p_data, size_t *p_data_length)
Retrieve data associated with a provided UID.
void tfm_its_test_common_008(struct test_result_t *ret)
Tests get function with:
psa_status_t psa_its_remove(psa_storage_uid_t uid)
Remove the provided uid and its associated data from the storage.
void tfm_its_test_common_005(struct test_result_t *ret)
Tests get function with:
void tfm_its_test_common_004(struct test_result_t *ret)
Tests set function with:
#define PSA_ERROR_INVALID_ARGUMENT
psa_status_t psa_its_set(psa_storage_uid_t uid, size_t data_length, const void *p_data, psa_storage_create_flags_t create_flags)
Create a new, or modify an existing, uid/value pair.
void tfm_its_test_common_001(struct test_result_t *ret)
Tests set function with:
#define HALF_PADDING_SIZE
void tfm_its_test_common_015(struct test_result_t *ret)
Tests remove function with:
uint64_t psa_storage_uid_t
void tfm_its_test_common_003(struct test_result_t *ret)
Tests set function with:
void tfm_its_test_common_013(struct test_result_t *ret)
Tests remove function with:
__STATIC_INLINE int tfm_memcmp(const void *ptr1, const void *ptr2, size_t num)
#define PSA_STORAGE_FLAG_NONE
void tfm_its_test_common_018(struct test_result_t *ret)
Tests multiple sets to the same UID.
#define PSA_ERROR_DOES_NOT_EXIST
uint32_t psa_storage_create_flags_t
#define TEST_UID_ACCESS_CONTROL
void tfm_its_test_common_009(struct test_result_t *ret)
Tests get function with:
#define TFM_SECURE_CLIENT_2_ID_ITS_ACCESS_CTRL
int32_t psa_status_t
Function return status.
void tfm_its_test_common_014(struct test_result_t *ret)
Tests remove function with:
void tfm_its_test_common_006(struct test_result_t *ret)
Tests get function with: