aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdison Ai <edison.ai@arm.com>2019-06-21 14:19:56 +0800
committerKen Liu <ken.liu@arm.com>2019-07-19 10:14:51 +0000
commitabbdd631c30e9a41a4259b8170aac5436fe73b67 (patch)
tree949fcdfb74b20314d18c6169b780b39e9bdee991
parentcc4c6163f9d8d32371b323c5343a7dab7d42d457 (diff)
downloadtrusted-firmware-m-abbdd631c30e9a41a4259b8170aac5436fe73b67.tar.gz
Test: Use macros generated by tools
- Use the SID and service version defined in sid.h. - Use signal defined in signal files. - Remove manual definitions. - Remove unused header files. Change-Id: I4dcc8ef09c1ab45177ae018b8f396b40cd75c15f Signed-off-by: Edison Ai <edison.ai@arm.com>
-rw-r--r--app/tfm_integ_test.c7
-rw-r--r--test/suites/core/non_secure/core_ns_positive_testsuite.c44
-rw-r--r--test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c38
-rw-r--r--test/test_services/tfm_core_test/core_test_defs.h45
-rw-r--r--test/test_services/tfm_core_test/tfm_ss_core_test.c12
-rw-r--r--test/test_services/tfm_core_test/tfm_ss_core_test_signal.h29
-rw-r--r--test/test_services/tfm_core_test_2/tfm_ss_core_test_2.c2
-rw-r--r--test/test_services/tfm_core_test_2/tfm_ss_core_test_2_signal.h23
-rw-r--r--test/test_services/tfm_ipc_client/tfm_ipc_client_partition.h20
-rw-r--r--test/test_services/tfm_ipc_client/tfm_ipc_client_test.c28
-rw-r--r--test/test_services/tfm_ipc_service/tfm_ipc_service_partition.h19
-rw-r--r--test/test_services/tfm_ipc_service/tfm_ipc_service_test.c2
-rw-r--r--test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1_signal.h19
-rw-r--r--test/test_services/tfm_secure_client_service/tfm_secure_client_service_api.c10
14 files changed, 58 insertions, 240 deletions
diff --git a/app/tfm_integ_test.c b/app/tfm_integ_test.c
index 2d0180948e..5e7e722309 100644
--- a/app/tfm_integ_test.c
+++ b/app/tfm_integ_test.c
@@ -16,6 +16,9 @@
#include "tfm_integ_test.h"
#include "test/framework/test_framework_integ_test.h"
+#ifdef TFM_PSA_API
+#include "psa_manifest/sid.h"
+#endif
#ifdef TEST_FRAMEWORK_S
#include \
@@ -81,7 +84,7 @@ void secure_decrement_ns_lock_1(void)
psa_status_t err;
err = psa_test_common(SPM_CORE_TEST_BLOCK_SID,
- SPM_CORE_TEST_BLOCK_MIN_VER,
+ SPM_CORE_TEST_BLOCK_VERSION,
NULL, 0, NULL, 0);
if (err != PSA_SUCCESS) {
LOG_MSG("Secure call to sfn block failed, generic!");
@@ -104,7 +107,7 @@ void secure_decrement_ns_lock_2(void)
psa_status_t err;
err = psa_test_common(SPM_CORE_TEST_BLOCK_SID,
- SPM_CORE_TEST_BLOCK_MIN_VER,
+ SPM_CORE_TEST_BLOCK_VERSION,
NULL, 0, NULL, 0);
if (err != PSA_SUCCESS) {
LOG_MSG("Secure call to sfn block failed, generic!");
diff --git a/test/suites/core/non_secure/core_ns_positive_testsuite.c b/test/suites/core/non_secure/core_ns_positive_testsuite.c
index d359cd2edd..571bd22565 100644
--- a/test/suites/core/non_secure/core_ns_positive_testsuite.c
+++ b/test/suites/core/non_secure/core_ns_positive_testsuite.c
@@ -14,7 +14,9 @@
#include "test/suites/core/non_secure/core_test_api.h"
#include "test/test_services/tfm_core_test/core_test_defs.h"
#include "platform_irq.h"
-#ifndef TFM_PSA_API
+#ifdef TFM_PSA_API
+#include "psa_manifest/sid.h"
+#else /* TFM_PSA_API */
#include "tfm_veneers.h"
#endif /* TFM_PSA_API */
@@ -140,7 +142,7 @@ static void tfm_core_test_ns_thread(struct test_result_t *ret)
err = tfm_spm_core_test_sfn_veneer(in_vec, 1, NULL, 0);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_NS_THREAD_SID,
- SPM_CORE_TEST_NS_THREAD_MIN_VER,
+ SPM_CORE_TEST_NS_THREAD_VERSION,
NULL, 0, NULL, 0);
#endif /* TFM_PSA_API */
@@ -164,7 +166,7 @@ static void tfm_core_test_peripheral_access(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_sfn_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_PERIPHERAL_ACCESS_SID,
- SPM_CORE_TEST_PERIPHERAL_ACCESS_MIN_VER,
+ SPM_CORE_TEST_PERIPHERAL_ACCESS_VERSION,
NULL, 0, NULL, 0);
#endif /* TFM_PSA_API */
@@ -229,7 +231,7 @@ static void tfm_core_test_iovec_sanitization(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_2_slave_service_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
- SPM_CORE_TEST_2_SLAVE_SERVICE_MIN_VER,
+ SPM_CORE_TEST_2_SLAVE_SERVICE_VERSION,
NULL, 0, NULL, 0);
#endif /* TFM_PSA_API */
if (err != CORE_TEST_ERRNO_SUCCESS_2) {
@@ -247,7 +249,7 @@ static void tfm_core_test_iovec_sanitization(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_2_slave_service_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
- SPM_CORE_TEST_2_SLAVE_SERVICE_MIN_VER,
+ SPM_CORE_TEST_2_SLAVE_SERVICE_VERSION,
in_vec, 2, out_vec, 2);
#endif /* TFM_PSA_API */
if (err != CORE_TEST_ERRNO_SUCCESS_2) {
@@ -265,7 +267,7 @@ static void tfm_core_test_iovec_sanitization(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_2_slave_service_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
- SPM_CORE_TEST_2_SLAVE_SERVICE_MIN_VER,
+ SPM_CORE_TEST_2_SLAVE_SERVICE_VERSION,
in_vec, 2, out_vec, 1);
#endif /* TFM_PSA_API */
if (err != CORE_TEST_ERRNO_SUCCESS_2) {
@@ -291,7 +293,7 @@ static void tfm_core_test_iovec_sanitization(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_2_slave_service_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
- SPM_CORE_TEST_2_SLAVE_SERVICE_MIN_VER,
+ SPM_CORE_TEST_2_SLAVE_SERVICE_VERSION,
in_vec, 2, out_vec, 1);
#endif /* TFM_PSA_API */
if (err != CORE_TEST_ERRNO_SUCCESS_2) {
@@ -312,7 +314,7 @@ static void tfm_core_test_iovec_sanitization(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_2_slave_service_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
- SPM_CORE_TEST_2_SLAVE_SERVICE_MIN_VER,
+ SPM_CORE_TEST_2_SLAVE_SERVICE_VERSION,
in_vec, 2, out_vec, 1);
#endif /* TFM_PSA_API */
if (err != CORE_TEST_ERRNO_SUCCESS_2) {
@@ -332,7 +334,7 @@ static void tfm_core_test_iovec_sanitization(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_2_slave_service_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
- SPM_CORE_TEST_2_SLAVE_SERVICE_MIN_VER,
+ SPM_CORE_TEST_2_SLAVE_SERVICE_VERSION,
in_vec, 2, out_vec, 2);
#endif /* TFM_PSA_API */
if (err != CORE_TEST_ERRNO_SUCCESS_2) {
@@ -352,7 +354,7 @@ static void tfm_core_test_iovec_sanitization(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_2_slave_service_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
- SPM_CORE_TEST_2_SLAVE_SERVICE_MIN_VER,
+ SPM_CORE_TEST_2_SLAVE_SERVICE_VERSION,
in_vec, 2, out_vec, 2);
#endif /* TFM_PSA_API */
if (err != CORE_TEST_ERRNO_SUCCESS_2) {
@@ -385,7 +387,7 @@ static void tfm_core_test_outvec_write(struct test_result_t *ret)
&args1);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SID,
- SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_MIN_VER,
+ SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_VERSION,
in_vec, 2, out_vec, 2);
#endif /* TFM_PSA_API */
@@ -419,7 +421,7 @@ static void tfm_core_test_outvec_write(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_sfn_veneer, &args2);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_OUTVEC_WRITE_SID,
- SPM_CORE_TEST_OUTVEC_WRITE_MIN_VER,
+ SPM_CORE_TEST_OUTVEC_WRITE_VERSION,
in_vec, 0, out_vec, 0);
#endif /* TFM_PSA_API */
@@ -522,7 +524,7 @@ static int32_t tfm_core_test_irq_scenario(
#ifdef TFM_PSA_API
err = psa_test_common(SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO_SID,
- SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO_MIN_VER,
+ SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO_VERSION,
in_vec, 2, NULL, 0);
#else
err = tfm_spm_irq_test_1_prepare_test_scenario_veneer(in_vec, 2, NULL, 0);
@@ -533,7 +535,7 @@ static int32_t tfm_core_test_irq_scenario(
#ifdef TFM_PSA_API
err = psa_test_common(SPM_CORE_TEST_2_PREPARE_TEST_SCENARIO_SID,
- SPM_CORE_TEST_2_PREPARE_TEST_SCENARIO_MIN_VER,
+ SPM_CORE_TEST_2_PREPARE_TEST_SCENARIO_VERSION,
in_vec, 2, NULL, 0);
#else
err = tfm_spm_core_test_2_prepare_test_scenario_veneer(in_vec, 2, NULL, 0);
@@ -549,7 +551,7 @@ static int32_t tfm_core_test_irq_scenario(
#ifdef TFM_PSA_API
err = psa_test_common(SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO_SID,
- SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO_MIN_VER,
+ SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO_VERSION,
in_vec, 2, NULL, 0);
#else
err = tfm_spm_irq_test_1_execute_test_scenario_veneer(in_vec, 1, NULL, 0);
@@ -560,7 +562,7 @@ static int32_t tfm_core_test_irq_scenario(
#ifdef TFM_PSA_API
err = psa_test_common(SPM_CORE_TEST_2_EXECUTE_TEST_SCENARIO_SID,
- SPM_CORE_TEST_2_EXECUTE_TEST_SCENARIO_MIN_VER,
+ SPM_CORE_TEST_2_EXECUTE_TEST_SCENARIO_VERSION,
in_vec, 2, NULL, 0);
#else
err = tfm_spm_core_test_2_execute_test_scenario_veneer(in_vec, 1, NULL, 0);
@@ -629,7 +631,7 @@ static void tfm_core_test_check_init(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_sfn_init_success_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_INIT_SUCCESS_SID,
- SPM_CORE_TEST_INIT_SUCCESS_MIN_VER,
+ SPM_CORE_TEST_INIT_SUCCESS_VERSION,
NULL, 0, NULL, 0);
#endif /* TFM_PSA_API */
@@ -730,7 +732,7 @@ static void tfm_core_test_buffer_check(struct test_result_t *ret)
res = tfm_core_test_call(tfm_spm_core_test_2_sfn_invert_veneer, &args);
#else /* TFM_PSA_API */
res = psa_test_common(SPM_CORE_TEST_2_INVERT_SID,
- SPM_CORE_TEST_2_INVERT_MIN_VER,
+ SPM_CORE_TEST_2_INVERT_VERSION,
in_vec, 1, outvec, 2);
#endif /* TFM_PSA_API */
if (res != CORE_TEST_ERRNO_SUCCESS) {
@@ -770,7 +772,7 @@ static void tfm_core_test_ss_to_ss(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_sfn_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_SS_TO_SS_SID,
- SPM_CORE_TEST_SS_TO_SS_MIN_VER,
+ SPM_CORE_TEST_SS_TO_SS_VERSION,
NULL, 0, NULL, 0);
#endif /* TFM_PSA_API */
@@ -822,7 +824,7 @@ static void tfm_core_test_ss_to_ss_buffer(struct test_result_t *ret)
{&len, sizeof(int32_t)} };
res = psa_test_common(SPM_CORE_TEST_SS_TO_SS_BUFFER_SID,
- SPM_CORE_TEST_SS_TO_SS_BUFFER_MIN_VER,
+ SPM_CORE_TEST_SS_TO_SS_BUFFER_VERSION,
in_vec, 2, out_vec, 1);
#endif /* TFM_PSA_API */
switch (res) {
@@ -885,7 +887,7 @@ static void tfm_core_test_spm_request(struct test_result_t *ret)
err = tfm_core_test_call(tfm_spm_core_test_sfn_veneer, &args);
#else /* TFM_PSA_API */
err = psa_test_common(SPM_CORE_TEST_SPM_REQUEST_SID,
- SPM_CORE_TEST_SPM_REQUEST_MIN_VER,
+ SPM_CORE_TEST_SPM_REQUEST_VERSION,
NULL, 0, NULL, 0);
#endif /* TFM_PSA_API */
diff --git a/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c b/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c
index 7fd56b5bb2..3d1eb06f5f 100644
--- a/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c
+++ b/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c
@@ -9,25 +9,9 @@
#include "ipc_ns_tests.h"
#include "psa/client.h"
#include "test/framework/test_framework_helpers.h"
-
-/* Define the SID. These SIDs should align with the value in manifest file. */
-#define IPC_CLIENT_TEST_BASIC_SID (0x0000F060)
-#define IPC_CLIENT_TEST_PSA_ACCESS_APP_MEM_SID (0x0000F061)
-#define IPC_CLIENT_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SID (0x0000F062)
-#define IPC_CLIENT_TEST_APP_ACCESS_PSA_MEM_SID (0x0000F063)
-#define IPC_CLIENT_TEST_MEM_CHECK_SID (0x0000F064)
-#define IPC_SERVICE_TEST_BASIC_SID (0x0000F080)
-
-/*
- * Define the MIN_VER. These MIN_VER should align with the value in
- * manifest file.
- */
-#define IPC_CLIENT_TEST_BASIC_MIN_VER (0x0001)
-#define IPC_CLIENT_TEST_PSA_ACCESS_APP_MEM_MIN_VER (0x0001)
-#define IPC_CLIENT_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_MIN_VER (0x0001)
-#define IPC_CLIENT_TEST_APP_ACCESS_PSA_MEM_MIN_VER (0x0001)
-#define IPC_CLIENT_TEST_MEM_CHECK_MIN_VER (0x0001)
-#define IPC_BASIC_MIN_VER (0x0001)
+#ifdef TFM_PSA_API
+#include "psa_manifest/sid.h"
+#endif
/* List of tests */
static void tfm_ipc_test_1001(struct test_result_t *ret);
@@ -144,7 +128,8 @@ static void tfm_ipc_test_1003(struct test_result_t *ret)
{
psa_handle_t handle;
- handle = psa_connect(IPC_SERVICE_TEST_BASIC_SID, IPC_BASIC_MIN_VER);
+ handle = psa_connect(IPC_SERVICE_TEST_BASIC_SID,
+ IPC_SERVICE_TEST_BASIC_VERSION);
if (handle > 0) {
TEST_LOG("Connect success!\r\n");
} else {
@@ -173,7 +158,8 @@ static void tfm_ipc_test_1004(struct test_result_t *ret)
min_version = psa_version(IPC_SERVICE_TEST_BASIC_SID);
TEST_LOG("TFM service support minor version is %d.\r\n", min_version);
- handle = psa_connect(IPC_SERVICE_TEST_BASIC_SID, IPC_BASIC_MIN_VER);
+ handle = psa_connect(IPC_SERVICE_TEST_BASIC_SID,
+ IPC_SERVICE_TEST_BASIC_VERSION);
status = psa_call(handle, invecs, 2, outvecs, 2);
if (status >= 0) {
TEST_LOG("psa_call is successful!\r\n");
@@ -202,7 +188,7 @@ static void tfm_ipc_test_1005(struct test_result_t *ret)
struct psa_outvec outvecs[1] = {{&test_result, sizeof(test_result)}};
handle = psa_connect(IPC_CLIENT_TEST_BASIC_SID,
- IPC_CLIENT_TEST_BASIC_MIN_VER);
+ IPC_CLIENT_TEST_BASIC_VERSION);
if (handle > 0) {
TEST_LOG("Connect success!");
} else {
@@ -239,7 +225,7 @@ static void tfm_ipc_test_1006(struct test_result_t *ret)
struct psa_outvec outvecs[1] = {{&test_result, sizeof(test_result)}};
handle = psa_connect(IPC_CLIENT_TEST_PSA_ACCESS_APP_MEM_SID,
- IPC_CLIENT_TEST_PSA_ACCESS_APP_MEM_MIN_VER);
+ IPC_CLIENT_TEST_PSA_ACCESS_APP_MEM_VERSION);
if (handle > 0) {
TEST_LOG("Connect success!");
} else {
@@ -276,7 +262,7 @@ static void tfm_ipc_test_1007(struct test_result_t *ret)
struct psa_outvec outvecs[1] = {{&test_result, sizeof(test_result)}};
handle = psa_connect(IPC_CLIENT_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SID,
- IPC_CLIENT_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_MIN_VER);
+ IPC_CLIENT_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_VERSION);
if (handle > 0) {
TEST_LOG("Connect success!");
} else {
@@ -305,7 +291,7 @@ static void tfm_ipc_test_1008(struct test_result_t *ret)
struct psa_outvec outvecs[1] = {{&test_result, sizeof(test_result)}};
handle = psa_connect(IPC_CLIENT_TEST_APP_ACCESS_PSA_MEM_SID,
- IPC_CLIENT_TEST_APP_ACCESS_PSA_MEM_MIN_VER);
+ IPC_CLIENT_TEST_APP_ACCESS_PSA_MEM_VERSION);
if (handle > 0) {
TEST_LOG("Connect success!");
} else {
@@ -334,7 +320,7 @@ static void tfm_ipc_test_1009(struct test_result_t *ret)
struct psa_outvec outvecs[1] = {{&test_result, sizeof(test_result)}};
handle = psa_connect(IPC_CLIENT_TEST_MEM_CHECK_SID,
- IPC_CLIENT_TEST_MEM_CHECK_MIN_VER);
+ IPC_CLIENT_TEST_MEM_CHECK_VERSION);
if (handle > 0) {
TEST_LOG("Connect success!");
} else {
diff --git a/test/test_services/tfm_core_test/core_test_defs.h b/test/test_services/tfm_core_test/core_test_defs.h
index f51f7567bd..11c11892ad 100644
--- a/test/test_services/tfm_core_test/core_test_defs.h
+++ b/test/test_services/tfm_core_test/core_test_defs.h
@@ -35,51 +35,6 @@ extern "C" {
#define CORE_TEST_ID_SECURE_IRQ 1017
#define CORE_TEST_ID_BLOCK 2001
-#define SPM_CORE_TEST_INIT_SUCCESS_SID 0x0000F020
-#define SPM_CORE_TEST_DIRECT_RECURSION_SID 0x0000F021
-#define SPM_CORE_TEST_MPU_ACCESS_SID 0x0000F022
-#define SPM_CORE_TEST_MEMORY_PERMISSIONS_SID 0x0000F023
-#define SPM_CORE_TEST_SHARE_REDIRECTION_SID 0x0000F024
-#define SPM_CORE_TEST_SS_TO_SS_SID 0x0000F025
-#define SPM_CORE_TEST_SS_TO_SS_BUFFER_SID 0x0000F026
-#define SPM_CORE_TEST_OUTVEC_WRITE_SID 0x0000F027
-#define SPM_CORE_TEST_PERIPHERAL_ACCESS_SID 0x0000F028
-#define SPM_CORE_TEST_GET_CALLER_CLIENT_ID_SID 0x0000F029
-#define SPM_CORE_TEST_SPM_REQUEST_SID 0x0000F02A
-#define SPM_CORE_TEST_BLOCK_SID 0x0000F02B
-#define SPM_CORE_TEST_NS_THREAD_SID 0x0000F02C
-#define SPM_CORE_TEST_INIT_SUCCESS_MIN_VER 0x0001
-#define SPM_CORE_TEST_DIRECT_RECURSION_MIN_VER 0x0001
-#define SPM_CORE_TEST_MPU_ACCESS_MIN_VER 0x0001
-#define SPM_CORE_TEST_MEMORY_PERMISSIONS_MIN_VER 0x0001
-#define SPM_CORE_TEST_SHARE_REDIRECTION_MIN_VER 0x0001
-#define SPM_CORE_TEST_SS_TO_SS_MIN_VER 0x0001
-#define SPM_CORE_TEST_SS_TO_SS_BUFFER_MIN_VER 0x0001
-#define SPM_CORE_TEST_OUTVEC_WRITE_MIN_VER 0x0001
-#define SPM_CORE_TEST_PERIPHERAL_ACCESS_MIN_VER 0x0001
-#define SPM_CORE_TEST_GET_CALLER_CLIENT_ID_MIN_VER 0x0001
-#define SPM_CORE_TEST_SPM_REQUEST_MIN_VER 0x0001
-#define SPM_CORE_TEST_BLOCK_MIN_VER 0x0001
-#define SPM_CORE_TEST_NS_THREAD_MIN_VER 0x0001
-
-#define SPM_CORE_TEST_2_SLAVE_SERVICE_SID 0x0000F040
-#define SPM_CORE_TEST_2_CHECK_CALLER_CLIENT_ID_SID 0x0000F041
-#define SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SID 0x0000F042
-#define SPM_CORE_TEST_2_INVERT_SID 0x0000F043
-#define SPM_CORE_TEST_2_PREPARE_TEST_SCENARIO_SID 0x0000F044
-#define SPM_CORE_TEST_2_EXECUTE_TEST_SCENARIO_SID 0x0000F045
-#define SPM_CORE_TEST_2_SLAVE_SERVICE_MIN_VER 0x0001
-#define SPM_CORE_TEST_2_CHECK_CALLER_CLIENT_ID_MIN_VER 0x0001
-#define SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_MIN_VER 0x0001
-#define SPM_CORE_TEST_2_INVERT_MIN_VER 0x0001
-#define SPM_CORE_TEST_2_PREPARE_TEST_SCENARIO_MIN_VER 0x0001
-#define SPM_CORE_TEST_2_EXECUTE_TEST_SCENARIO_MIN_VER 0x0001
-
-#define SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO_SID 0x0000F0A0
-#define SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO_SID 0x0000F0A1
-#define SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO_MIN_VER 0x0001
-#define SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO_MIN_VER 0x0001
-
enum irq_test_scenario_t {
IRQ_TEST_SCENARIO_NONE,
IRQ_TEST_SCENARIO_1,
diff --git a/test/test_services/tfm_core_test/tfm_ss_core_test.c b/test/test_services/tfm_core_test/tfm_ss_core_test.c
index 1b61307a0f..0e146fd765 100644
--- a/test/test_services/tfm_core_test/tfm_ss_core_test.c
+++ b/test/test_services/tfm_core_test/tfm_ss_core_test.c
@@ -15,9 +15,11 @@
#include "secure_fw/include/tfm_spm_services_api.h"
#include "spm_partition_defs.h"
#include "psa/service.h"
-#include "test/test_services/tfm_core_test/tfm_ss_core_test_signal.h"
-#include "test/test_services/tfm_core_test_2/tfm_ss_core_test_2_signal.h"
#include "tfm_plat_test.h"
+#include "psa_manifest/tfm_test_core.h"
+#ifdef TFM_PSA_API
+#include "psa_manifest/sid.h"
+#endif
static int32_t partition_init_done;
@@ -293,7 +295,7 @@ static psa_status_t test_ss_to_ss_buffer(uint32_t *in_ptr, uint32_t *out_ptr,
#ifdef TFM_PSA_API
res = psa_test_common(SPM_CORE_TEST_2_INVERT_SID,
- SPM_CORE_TEST_2_INVERT_MIN_VER,
+ SPM_CORE_TEST_2_INVERT_VERSION,
in_vec, 1, outvec, 2);
#else /* defined(TFM_PSA_API) */
res = tfm_spm_core_test_2_sfn_invert_veneer(in_vec, 1, outvec, 2);
@@ -376,7 +378,7 @@ static psa_status_t test_outvec_write(void)
#ifdef TFM_PSA_API
err = psa_test_common(SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SID,
- SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_MIN_VER,
+ SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_VERSION,
in_vec, 2, out_vec, 2);
#else /* defined(TFM_PSA_API) */
err = tfm_spm_core_test_2_get_every_second_byte_veneer(in_vec, 2,
@@ -417,7 +419,7 @@ static psa_status_t test_ss_to_ss(void)
/* Call to a different service, should be successful */
#ifdef TFM_PSA_API
ret = psa_test_common(SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
- SPM_CORE_TEST_2_SLAVE_SERVICE_MIN_VER,
+ SPM_CORE_TEST_2_SLAVE_SERVICE_VERSION,
NULL, 0, NULL, 0);
#else /* defined(TFM_PSA_API) */
ret = tfm_spm_core_test_2_slave_service_veneer(NULL, 0, NULL, 0);
diff --git a/test/test_services/tfm_core_test/tfm_ss_core_test_signal.h b/test/test_services/tfm_core_test/tfm_ss_core_test_signal.h
deleted file mode 100644
index 017c50519f..0000000000
--- a/test/test_services/tfm_core_test/tfm_ss_core_test_signal.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_CORE_TEST_SIGNAL_H__
-#define __TFM_CORE_TEST_SIGNAL_H__
-
-/* FixMe: hardcode it for the tool cannot support now */
-#ifdef TFM_PSA_API
-
-#define SPM_CORE_TEST_INIT_SUCCESS_SIGNAL (1 << (0 + 4))
-#define SPM_CORE_TEST_DIRECT_RECURSION_SIGNAL (1 << (1 + 4))
-#define SPM_CORE_TEST_MPU_ACCESS_SIGNAL (1 << (2 + 4))
-#define SPM_CORE_TEST_MEMORY_PERMISSIONS_SIGNAL (1 << (3 + 4))
-#define SPM_CORE_TEST_SHARE_REDIRECTION_SIGNAL (1 << (4 + 4))
-#define SPM_CORE_TEST_SS_TO_SS_SIGNAL (1 << (5 + 4))
-#define SPM_CORE_TEST_SS_TO_SS_BUFFER_SIGNAL (1 << (6 + 4))
-#define SPM_CORE_TEST_OUTVEC_WRITE_SIGNAL (1 << (7 + 4))
-#define SPM_CORE_TEST_PERIPHERAL_ACCESS_SIGNAL (1 << (8 + 4))
-#define SPM_CORE_TEST_GET_CALLER_CLIENT_ID_SIGNAL (1 << (9 + 4))
-#define SPM_CORE_TEST_SPM_REQUEST_SIGNAL (1 << (10 + 4))
-#define SPM_CORE_TEST_BLOCK_SIGNAL (1 << (11 + 4))
-#define SPM_CORE_TEST_NS_THREAD_SIGNAL (1 << (12 + 4))
-#endif /* TFM_PSA_API */
-
-#endif /* __TFM_CORE_TEST_SIGNAL_H__ */
diff --git a/test/test_services/tfm_core_test_2/tfm_ss_core_test_2.c b/test/test_services/tfm_core_test_2/tfm_ss_core_test_2.c
index 49b605e204..029bc6d412 100644
--- a/test/test_services/tfm_core_test_2/tfm_ss_core_test_2.c
+++ b/test/test_services/tfm_core_test_2/tfm_ss_core_test_2.c
@@ -12,7 +12,7 @@
#include "tfm_secure_api.h"
#include "spm_partition_defs.h"
#include "psa/service.h"
-#include "tfm_ss_core_test_2_signal.h"
+#include "psa_manifest/tfm_test_core_2.h"
#define INVALID_NS_CLIENT_ID 0x49abcdef
#define INVERT_BUFFER_SIZE (16*4)
diff --git a/test/test_services/tfm_core_test_2/tfm_ss_core_test_2_signal.h b/test/test_services/tfm_core_test_2/tfm_ss_core_test_2_signal.h
deleted file mode 100644
index e95c72b9de..0000000000
--- a/test/test_services/tfm_core_test_2/tfm_ss_core_test_2_signal.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_CORE_TEST_2_SIGNAL_H__
-#define __TFM_CORE_TEST_2_SIGNAL_H__
-
-/* FixMe: hardcode it for the tool cannot support now */
-#ifdef TFM_PSA_API
-
-#define SPM_CORE_TEST_2_SLAVE_SERVICE_SIGNAL (1 << (0 + 4))
-#define SPM_CORE_TEST_2_CHECK_CALLER_CLIENT_ID_SIGNAL (1 << (1 + 4))
-#define SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SIGNAL (1 << (2 + 4))
-#define SPM_CORE_TEST_2_INVERT_SIGNAL (1 << (3 + 4))
-#define SPM_CORE_TEST_2_PREPARE_TEST_SCENARIO_SIGNAL (1 << (4 + 4))
-#define SPM_CORE_TEST_2_EXECUTE_TEST_SCENARIO_SIGNAL (1 << (5 + 4))
-
-#endif /* TFM_PSA_API */
-
-#endif /* __TFM_CORE_TEST_2_SIGNAL_H__ */
diff --git a/test/test_services/tfm_ipc_client/tfm_ipc_client_partition.h b/test/test_services/tfm_ipc_client/tfm_ipc_client_partition.h
deleted file mode 100644
index 4ba1c29f11..0000000000
--- a/test/test_services/tfm_ipc_client/tfm_ipc_client_partition.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_IPC_CLIENT_PARTITION_H__
-#define __TFM_IPC_CLIENT_PARTITION_H__
-
-/* FixMe: hardcode it for the tool cannot support now */
-#ifdef TFM_PSA_API
-#define IPC_CLIENT_TEST_BASIC_SIGNAL (1 << (0 + 4))
-#define IPC_CLIENT_TEST_PSA_ACCESS_APP_MEM_SIGNAL (1 << (1 + 4))
-#define IPC_CLIENT_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SIGNAL (1 << (2 + 4))
-#define IPC_CLIENT_TEST_APP_ACCESS_PSA_MEM_SIGNAL (1 << (3 + 4))
-#define IPC_CLIENT_TEST_MEM_CHECK_SIGNAL (1 << (4 + 4))
-#endif /* TFM_PSA_API */
-
-#endif /* __TFM_IPC_CLIENT_PARTITION_H__ */
diff --git a/test/test_services/tfm_ipc_client/tfm_ipc_client_test.c b/test/test_services/tfm_ipc_client/tfm_ipc_client_test.c
index ac66f8d596..f486592007 100644
--- a/test/test_services/tfm_ipc_client/tfm_ipc_client_test.c
+++ b/test/test_services/tfm_ipc_client/tfm_ipc_client_test.c
@@ -10,23 +10,9 @@
#include "psa/client.h"
#include "secure_utilities.h"
#include "psa/service.h"
-#include "tfm_ipc_client_partition.h"
+#include "psa_manifest/tfm_ipc_client_partition.h"
#include "tfm_utils.h"
-
-/* Define the SID. These SIDs should align with the value in manifest file. */
-#define IPC_SERVICE_TEST_BASIC_SID (0x0000F080)
-#define IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM_SID (0x0000F081)
-#define IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SID (0x0000F082)
-#define IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_SID (0x0000F083)
-
-/*
- * Define the MIN_VER. These MIN_VER should align with the value in
- * manifest file.
- */
-#define IPC_SERVICE_TEST_BASIC_MIN_VER (0x0001)
-#define IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM_MIN_VER (0x0001)
-#define IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_MIN_VER (0x0001)
-#define IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_MIN_VER (0x0001)
+#include "psa_manifest/sid.h"
/* Define the return status */
#define IPC_SP_TEST_SUCCESS (1)
@@ -63,7 +49,7 @@ static int ipc_isolation_2_psa_access_app_readonly_memory(void)
struct psa_invec invecs[1] = {{&client_data_p, sizeof(client_data_p)}};
handle = psa_connect(IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SID,
- IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_MIN_VER);
+ IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_VERSION);
if (handle <= 0) {
return IPC_SP_TEST_FAILED;
@@ -87,7 +73,7 @@ static int ipc_isolation_2_psa_access_app_memory(void)
struct psa_invec invecs[1] = {{&client_data_p, sizeof(client_data_p)}};
handle = psa_connect(IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM_SID,
- IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM_MIN_VER);
+ IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM_VERSION);
if (handle <= 0) {
return result;
@@ -117,7 +103,7 @@ static int ipc_client_base_test(void)
{str4, sizeof(str4)/sizeof(char)}};
handle = psa_connect(IPC_SERVICE_TEST_BASIC_SID,
- IPC_SERVICE_TEST_BASIC_MIN_VER);
+ IPC_SERVICE_TEST_BASIC_VERSION);
if (handle <= 0) {
return result;
}
@@ -140,7 +126,7 @@ static int ipc_client_app_access_psa_mem_test(void)
struct psa_outvec outvecs[1] = {{outvec_data, sizeof(outvec_data[0])}};
handle = psa_connect(IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_SID,
- IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_MIN_VER);
+ IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_VERSION);
if (handle <= 0) {
return IPC_SP_TEST_FAILED;
@@ -174,7 +160,7 @@ static int ipc_client_mem_check_test(void)
struct psa_invec invecs[1] = {{NULL, 0}};
handle = psa_connect(IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_SID,
- IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_MIN_VER);
+ IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_VERSION);
if (handle <= 0) {
return IPC_SP_TEST_FAILED;
diff --git a/test/test_services/tfm_ipc_service/tfm_ipc_service_partition.h b/test/test_services/tfm_ipc_service/tfm_ipc_service_partition.h
deleted file mode 100644
index 21211a2cd3..0000000000
--- a/test/test_services/tfm_ipc_service/tfm_ipc_service_partition.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_IPC_SERVICE_PARTITION_H__
-#define __TFM_IPC_SERVICE_PARTITION_H__
-
-/* FixMe: hardcode it for the tool cannot support now */
-#ifdef TFM_PSA_API
-#define IPC_SERVICE_TEST_BASIC_SIGNAL (1 << (0 + 4))
-#define IPC_SERVICE_TEST_PSA_ACCESS_APP_MEM_SIGNAL (1 << (1 + 4))
-#define IPC_SERVICE_TEST_PSA_ACCESS_APP_READ_ONLY_MEM_SIGNAL (1 << (2 + 4))
-#define IPC_SERVICE_TEST_APP_ACCESS_PSA_MEM_SIGNAL (1 << (3 + 4))
-#endif /* TFM_PSA_API */
-
-#endif /* __TFM_IPC_SERVICE_PARTITION_H__ */
diff --git a/test/test_services/tfm_ipc_service/tfm_ipc_service_test.c b/test/test_services/tfm_ipc_service/tfm_ipc_service_test.c
index e2e15c40eb..d1935df761 100644
--- a/test/test_services/tfm_ipc_service/tfm_ipc_service_test.c
+++ b/test/test_services/tfm_ipc_service/tfm_ipc_service_test.c
@@ -13,7 +13,7 @@
#include "secure_fw/core/secure_utilities.h"
#include "secure_fw/core/tfm_secure_api.h"
#include "tfm_api.h"
-#include "tfm_ipc_service_partition.h"
+#include "psa_manifest/tfm_ipc_service_partition.h"
#define IPC_SERVICE_BUFFER_LEN 32
diff --git a/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1_signal.h b/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1_signal.h
deleted file mode 100644
index c6b13ab4df..0000000000
--- a/test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1_signal.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_IRQ_TEST_1_SERVICE_SIGNAL_H__
-#define __TFM_IRQ_TEST_1_SERVICE_SIGNAL_H__
-
-/* FixMe: hardcode it for the tool cannot support now */
-#ifdef TFM_PSA_API
-
-#define SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO_SIGNAL (1U << (4 + 4))
-#define SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO_SIGNAL (1U << (5 + 4))
-
-#endif /* TFM_PSA_API */
-
-#endif /* __TFM_IRQ_TEST_1_SERVICE_SIGNAL_H__ */
diff --git a/test/test_services/tfm_secure_client_service/tfm_secure_client_service_api.c b/test/test_services/tfm_secure_client_service/tfm_secure_client_service_api.c
index 4629db45f1..ff6af34106 100644
--- a/test/test_services/tfm_secure_client_service/tfm_secure_client_service_api.c
+++ b/test/test_services/tfm_secure_client_service/tfm_secure_client_service_api.c
@@ -9,13 +9,7 @@
#ifdef TFM_PSA_API
#include "psa/client.h"
#include "tfm_api.h"
-
-/*
- * Defines for SID and minor version number. These SIDs should align with the
- * value in service manifest file.
- */
-#define TFM_SECURE_CLIENT_SFN_RUN_TESTS_SID (0x0000F000)
-#define TFM_SECURE_CLIENT_SFN_RUN_TESTS_MIN_VER (0x00000001)
+#include "psa_manifest/sid.h"
#else /* TFM_PSA_API */
#include "tfm_secure_client_service_veneers.h"
#endif /* TFM_PSA_API */
@@ -27,7 +21,7 @@ int32_t tfm_secure_client_run_tests(void)
psa_status_t status;
handle = psa_connect(TFM_SECURE_CLIENT_SFN_RUN_TESTS_SID,
- TFM_SECURE_CLIENT_SFN_RUN_TESTS_MIN_VER);
+ TFM_SECURE_CLIENT_SFN_RUN_TESTS_VERSION);
if (handle <= 0) {
return TFM_ERROR_GENERIC;
}