tests: settings: cover PSA PS backend
Just like ITS, it can be tested on mps2/an521/cpu0/ns with TF-M. Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
This commit is contained in:
committed by
Fabio Baltieri
parent
0e04d8a802
commit
3117d7ad2c
@@ -26,8 +26,26 @@ LOG_MODULE_REGISTER(settings_basic_test);
|
||||
#include <zephyr/fs/littlefs.h>
|
||||
#elif defined(CONFIG_SETTINGS_TFM_PSA)
|
||||
|
||||
#if defined(CONFIG_SETTINGS_TFM_PSA_BACKEND_PS)
|
||||
#include <psa/protected_storage.h>
|
||||
#include <zephyr/psa/ps_ids.h>
|
||||
|
||||
#define SETTINGS_PSA_MAX_ASSET_SIZE PS_MAX_ASSET_SIZE
|
||||
#define SETTINGS_PSA_REMOVE psa_ps_remove
|
||||
#define SETTINGS_PSA_ID_RANGE_START ZEPHYR_PSA_SETTINGS_TFM_PS_UID_RANGE_BEGIN
|
||||
|
||||
#elif defined(CONFIG_SETTINGS_TFM_PSA_BACKEND_ITS)
|
||||
#include <psa/internal_trusted_storage.h>
|
||||
#include <zephyr/psa/its_ids.h>
|
||||
|
||||
#define SETTINGS_PSA_MAX_ASSET_SIZE ITS_MAX_ASSET_SIZE
|
||||
#define SETTINGS_PSA_REMOVE psa_its_remove
|
||||
#define SETTINGS_PSA_ID_RANGE_START ZEPHYR_PSA_SETTINGS_TFM_ITS_UID_RANGE_BEGIN
|
||||
|
||||
#else
|
||||
#error "No PSA backend selected"
|
||||
#endif /* CONFIG_SETTINGS_TFM_PSA_BACKEND */
|
||||
|
||||
/* TF-M config file containing ITS_MAX_ASSET_SIZE */
|
||||
#include <config_base.h>
|
||||
|
||||
@@ -49,10 +67,10 @@ ZTEST(settings_functional, test_clear_settings)
|
||||
#if defined(CONFIG_SETTINGS_TFM_PSA)
|
||||
psa_status_t status;
|
||||
|
||||
/* Remove all potentially accessed ITS entries in the UID range */
|
||||
/* Remove all potentially accessed entries in the UID range */
|
||||
for (int i = 0; i < sizeof(struct setting_entry) * CONFIG_SETTINGS_TFM_PSA_NUM_ENTRIES /
|
||||
ITS_MAX_ASSET_SIZE + 1; i++) {
|
||||
status = psa_its_remove(ZEPHYR_PSA_SETTINGS_TFM_ITS_UID_RANGE_BEGIN + i);
|
||||
SETTINGS_PSA_MAX_ASSET_SIZE + 1; i++) {
|
||||
status = SETTINGS_PSA_REMOVE(SETTINGS_PSA_ID_RANGE_START + i);
|
||||
zassert_true((status == PSA_SUCCESS) || (status == PSA_ERROR_DOES_NOT_EXIST),
|
||||
"psa_its_remove failed");
|
||||
}
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
common:
|
||||
integration_platforms:
|
||||
- max32657evkit/max32657/ns
|
||||
- nrf5340dk/nrf5340/cpuapp/ns
|
||||
- nrf54l15dk/nrf54l15/cpuapp/ns
|
||||
- nrf54lm20dk/nrf54lm20a/cpuapp/ns
|
||||
- mps2/an521/cpu0/ns
|
||||
platform_exclude:
|
||||
- lpcxpresso55s69/lpc55s69/cpu0/ns
|
||||
tags:
|
||||
- settings
|
||||
- trusted-firmware-m
|
||||
extra_args:
|
||||
- CONFIG_SETTINGS_TFM_PSA=y
|
||||
|
||||
tests:
|
||||
settings.functional.tfm-ps:
|
||||
filter: CONFIG_TFM_PARTITION_PROTECTED_STORAGE
|
||||
extra_args:
|
||||
- CONFIG_SETTINGS_TFM_PSA_BACKEND_PS=y
|
||||
|
||||
settings.functional.tfm-its:
|
||||
filter: CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
|
||||
integration_platforms:
|
||||
- max32657evkit/max32657/ns
|
||||
- nrf5340dk/nrf5340/cpuapp/ns
|
||||
- nrf54l15dk/nrf54l15/cpuapp/ns
|
||||
- nrf54lm20dk/nrf54lm20a/cpuapp/ns
|
||||
- mps2/an521/cpu0/ns
|
||||
platform_exclude:
|
||||
- lpcxpresso55s69/lpc55s69/cpu0/ns
|
||||
tags:
|
||||
- settings
|
||||
- trusted-firmware-m
|
||||
extra_args:
|
||||
- CONFIG_SETTINGS_TFM_PSA=y
|
||||
- CONFIG_SETTINGS_TFM_PSA_BACKEND_ITS=y
|
||||
|
||||
@@ -2,16 +2,25 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
common:
|
||||
integration_platforms:
|
||||
- max32657evkit/max32657/ns
|
||||
- nrf5340dk/nrf5340/cpuapp/ns
|
||||
- nrf54l15dk/nrf54l15/cpuapp/ns
|
||||
- nrf54lm20dk/nrf54lm20a/cpuapp/ns
|
||||
- mps2/an521/cpu0/ns
|
||||
- lpcxpresso55s69/lpc55s69/cpu0/ns
|
||||
tags:
|
||||
- settings
|
||||
- trusted-firmware-m
|
||||
|
||||
tests:
|
||||
settings.tfm_psa_ps:
|
||||
filter: CONFIG_TFM_PARTITION_PROTECTED_STORAGE
|
||||
extra_args:
|
||||
- CONFIG_SETTINGS_TFM_PSA_BACKEND_PS=y
|
||||
|
||||
settings.tfm_psa_its:
|
||||
filter: CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
|
||||
integration_platforms:
|
||||
- max32657evkit/max32657/ns
|
||||
- nrf5340dk/nrf5340/cpuapp/ns
|
||||
- nrf54l15dk/nrf54l15/cpuapp/ns
|
||||
- nrf54lm20dk/nrf54lm20a/cpuapp/ns
|
||||
- mps2/an521/cpu0/ns
|
||||
- lpcxpresso55s69/lpc55s69/cpu0/ns
|
||||
tags:
|
||||
- settings
|
||||
- trusted-firmware-m
|
||||
extra_args:
|
||||
- CONFIG_SETTINGS_TFM_PSA_BACKEND_PS=y
|
||||
|
||||
Reference in New Issue
Block a user