TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
its_tests_common.h File Reference
Include dependency graph for its_tests_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WRITE_ONCE_UID   1U /* Cannot be modified or deleted once created */
 
#define TEST_UID_1   2U
 
#define TEST_UID_2   3U
 
#define TEST_UID_3   4U
 
#define INVALID_UID   0U
 
#define INVALID_DATA_LEN   UINT32_MAX
 
#define INVALID_OFFSET   UINT32_MAX
 
#define INVALID_FLAG   (1U << 31)
 
#define WRITE_ONCE_DATA   "THE_FIVE_BOXING_WIZARDS_JUMP_QUICKLY"
 
#define WRITE_ONCE_DATA_SIZE   (sizeof(WRITE_ONCE_DATA) - 1)
 
#define WRITE_ONCE_READ_DATA   "############################################"
 
#define WRITE_ONCE_RESULT_DATA   ("####" WRITE_ONCE_DATA "####")
 
#define WRITE_DATA   "THEQUICKBROWNFOXJUMPSOVERALAZYDOG"
 
#define WRITE_DATA_SIZE   (sizeof(WRITE_DATA) - 1)
 
#define READ_DATA   "_________________________________________"
 
#define RESULT_DATA   ("____" WRITE_DATA "____")
 
#define OFFSET_READ_DATA   "HEQUICKBROWNFOXJUMPSOVERALAZYDOG"
 
#define OFFSET_RESULT_DATA   ("____" OFFSET_READ_DATA "_____")
 
#define BUFFER_SIZE   24
 
#define PADDING_SIZE   8
 
#define HALF_PADDING_SIZE   4
 
#define BUFFER_PLUS_PADDING_SIZE   (BUFFER_SIZE + PADDING_SIZE)
 
#define BUFFER_PLUS_HALF_PADDING_SIZE   (BUFFER_SIZE + HALF_PADDING_SIZE)
 

Functions

void tfm_its_test_common_001 (struct test_result_t *ret)
 Tests set function with: More...
 
void tfm_its_test_common_002 (struct test_result_t *ret)
 Tests set function with: More...
 
void tfm_its_test_common_003 (struct test_result_t *ret)
 Tests set function with: More...
 
void tfm_its_test_common_004 (struct test_result_t *ret)
 Tests set function with: More...
 
void tfm_its_test_common_005 (struct test_result_t *ret)
 Tests get function with: More...
 
void tfm_its_test_common_006 (struct test_result_t *ret)
 Tests get function with: More...
 
void tfm_its_test_common_007 (struct test_result_t *ret)
 Tests get function with: More...
 
void tfm_its_test_common_008 (struct test_result_t *ret)
 Tests get function with: More...
 
void tfm_its_test_common_009 (struct test_result_t *ret)
 Tests get function with: More...
 
void tfm_its_test_common_010 (struct test_result_t *ret)
 Tests get info function with: More...
 
void tfm_its_test_common_011 (struct test_result_t *ret)
 Tests get info function with: More...
 
void tfm_its_test_common_012 (struct test_result_t *ret)
 Tests get info function with: More...
 
void tfm_its_test_common_013 (struct test_result_t *ret)
 Tests remove function with: More...
 
void tfm_its_test_common_014 (struct test_result_t *ret)
 Tests remove function with: More...
 
void tfm_its_test_common_015 (struct test_result_t *ret)
 Tests remove function with: More...
 
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. More...
 
void tfm_its_test_common_017 (struct test_result_t *ret)
 Tests set and multiple partial gets. More...
 
void tfm_its_test_common_018 (struct test_result_t *ret)
 Tests multiple sets to the same UID. More...
 
void tfm_its_test_common_019 (struct test_result_t *ret)
 Tests set, get_info, get and remove function with: More...
 

Macro Definition Documentation

#define BUFFER_PLUS_HALF_PADDING_SIZE   (BUFFER_SIZE + HALF_PADDING_SIZE)

Definition at line 58 of file its_tests_common.h.

#define BUFFER_PLUS_PADDING_SIZE   (BUFFER_SIZE + PADDING_SIZE)

Definition at line 57 of file its_tests_common.h.

#define BUFFER_SIZE   24

Several tests use a buffer to read back data from an asset. This buffer is larger than the size of the asset data by PADDING_SIZE bytes. This allows us to ensure that only the expected data is read back and that it is read back correctly.

For example if the buffer and asset are as follows: Buffer - "XXXXXXXXXXXX", Asset data - "AAAA"

Then a correct and successful read would give this result: "XXXXAAAAXXXX" (Assuming a PADDING_SIZE of 8)

Definition at line 54 of file its_tests_common.h.

#define HALF_PADDING_SIZE   4

Definition at line 56 of file its_tests_common.h.

#define INVALID_DATA_LEN   UINT32_MAX

Definition at line 25 of file its_tests_common.h.

#define INVALID_FLAG   (1U << 31)

Definition at line 27 of file its_tests_common.h.

#define INVALID_OFFSET   UINT32_MAX

Definition at line 26 of file its_tests_common.h.

#define INVALID_UID   0U

Definition at line 24 of file its_tests_common.h.

#define OFFSET_READ_DATA   "HEQUICKBROWNFOXJUMPSOVERALAZYDOG"

Definition at line 39 of file its_tests_common.h.

#define OFFSET_RESULT_DATA   ("____" OFFSET_READ_DATA "_____")

Definition at line 40 of file its_tests_common.h.

#define PADDING_SIZE   8

Definition at line 55 of file its_tests_common.h.

#define READ_DATA   "_________________________________________"

Definition at line 37 of file its_tests_common.h.

#define RESULT_DATA   ("____" WRITE_DATA "____")

Definition at line 38 of file its_tests_common.h.

#define TEST_UID_1   2U

Definition at line 19 of file its_tests_common.h.

#define TEST_UID_2   3U

Definition at line 20 of file its_tests_common.h.

#define TEST_UID_3   4U

Definition at line 21 of file its_tests_common.h.

#define WRITE_DATA   "THEQUICKBROWNFOXJUMPSOVERALAZYDOG"

Definition at line 35 of file its_tests_common.h.

#define WRITE_DATA_SIZE   (sizeof(WRITE_DATA) - 1)

Definition at line 36 of file its_tests_common.h.

#define WRITE_ONCE_DATA   "THE_FIVE_BOXING_WIZARDS_JUMP_QUICKLY"

Definition at line 30 of file its_tests_common.h.

#define WRITE_ONCE_DATA_SIZE   (sizeof(WRITE_ONCE_DATA) - 1)

Definition at line 31 of file its_tests_common.h.

#define WRITE_ONCE_READ_DATA   "############################################"

Definition at line 32 of file its_tests_common.h.

#define WRITE_ONCE_RESULT_DATA   ("####" WRITE_ONCE_DATA "####")

Definition at line 33 of file its_tests_common.h.

#define WRITE_ONCE_UID   1U /* Cannot be modified or deleted once created */

Definition at line 18 of file its_tests_common.h.

Function Documentation

void tfm_its_test_common_001 ( struct test_result_t ret)

Tests set function with:

  • Valid UID, no data, no flags
  • Invalid UID, no data, no flags
Parameters
[out]retTest result

Definition at line 21 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_002 ( struct test_result_t ret)

Tests set function with:

  • Zero create flags
  • Valid create flags (with previously created UID)
  • Invalid create flags
Parameters
[out]retTest result

Definition at line 60 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_003 ( struct test_result_t ret)

Tests set function with:

  • NULL data pointer and zero data length
Parameters
[out]retTest result
Note
A request with a null data pointer and data length not equal to zero is treated as a secure violation. TF-M framework will reject such requests and not return to the caller so this case is not tested here.

Definition at line 105 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_004 ( struct test_result_t ret)

Tests set function with:

  • Write once UID that has already been created
Parameters
[out]retTest result

Definition at line 122 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_005 ( struct test_result_t ret)

Tests get function with:

  • Valid data, zero offset
  • Valid data, non-zero offset
Parameters
[out]retTest result

Definition at line 171 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_006 ( struct test_result_t ret)

Tests get function with:

  • Zero data length, zero offset
  • Zero data length, non-zero offset
Parameters
[out]retTest result

Definition at line 278 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_007 ( struct test_result_t ret)

Tests get function with:

  • Unset UID
  • Invalid UID
Parameters
[out]retTest result

Definition at line 360 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_008 ( struct test_result_t ret)

Tests get function with:

  • Offset greater than UID length
  • Data length greater than UID length
  • Data length + offset greater than UID length
Parameters
[out]retTest result

Definition at line 411 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_009 ( struct test_result_t ret)

Tests get function with:

  • NULL data pointer and zero data length
Parameters
[out]retTest result
Note
A request with a null data pointer and data length not equal to zero is treated as a secure violation. TF-M framework will reject such requests and not return to the caller so this case is not tested here.

Definition at line 529 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_010 ( struct test_result_t ret)

Tests get info function with:

  • Write once UID
Parameters
[out]retTest result

Definition at line 569 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_011 ( struct test_result_t ret)

Tests get info function with:

  • Valid UID
Parameters
[out]retTest result

Definition at line 601 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_012 ( struct test_result_t ret)

Tests get info function with:

  • Unset UID
  • Invalid UID
Parameters
[out]retTest result

Definition at line 649 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_013 ( struct test_result_t ret)

Tests remove function with:

  • Valid UID
Parameters
[out]retTest result

Definition at line 694 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_014 ( struct test_result_t ret)

Tests remove function with:

  • Write once UID
Parameters
[out]retTest result

Definition at line 743 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_015 ( struct test_result_t ret)

Tests remove function with:

  • Invalid UID
Parameters
[out]retTest result

Definition at line 758 of file its_tests_common.c.

Here is the call graph for this function:

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.

Parameters
[out]retTest result

Definition at line 773 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_017 ( struct test_result_t ret)

Tests set and multiple partial gets.

Parameters
[out]retTest result

Definition at line 845 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_018 ( struct test_result_t ret)

Tests multiple sets to the same UID.

Parameters
[out]retTest result

Definition at line 895 of file its_tests_common.c.

Here is the call graph for this function:

void tfm_its_test_common_019 ( struct test_result_t ret)

Tests set, get_info, get and remove function with:

  • Valid UID's, No Flags
  • Data length of different asset sizes
Parameters
[out]retTest result

Definition at line 962 of file its_tests_common.c.

Here is the call graph for this function: