mirror of https://github.com/ARMmbed/mbed-os.git
Review fixes
parent
20d7f817df
commit
b62c48977f
|
@ -24,13 +24,6 @@
|
|||
#include "unity.h"
|
||||
#include "utest.h"
|
||||
#include "psa/client.h"
|
||||
|
||||
#ifndef USE_PSA_TEST_PARTITIONS
|
||||
#define USE_PSA_TEST_PARTITIONS
|
||||
#endif
|
||||
#ifndef USE_CLIENT_TESTS_PART1
|
||||
#define USE_CLIENT_TESTS_PART1
|
||||
#endif
|
||||
#include "psa_manifest/sid.h"
|
||||
|
||||
#if defined(TARGET_TFM)
|
||||
|
@ -105,7 +98,7 @@ static void client_ipc_tests_close(psa_handle_t handle)
|
|||
//Testing iovec 0 sent as NULL
|
||||
void iovec_0_NULL()
|
||||
{
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
uint8_t expect_size = 5;
|
||||
uint8_t off = 2;
|
||||
|
@ -128,7 +121,7 @@ void iovec_0_NULL()
|
|||
//Testing iovec 1 sent as NULL
|
||||
void iovec_1_NULL()
|
||||
{
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
uint8_t expect_size = 2;
|
||||
uint8_t off = 3;
|
||||
|
@ -150,7 +143,7 @@ void iovec_1_NULL()
|
|||
//Testing iovec 2 sent as NULL
|
||||
void iovec_2_NULL()
|
||||
{
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
uint8_t expect_size = 2;
|
||||
uint8_t off = 3;
|
||||
|
@ -175,7 +168,7 @@ void in_vec_base_not_NULL_size_0()
|
|||
uint8_t dummy_buff[] = {1, 2, 3, 4, 5};
|
||||
psa_invec iovec_temp[1] = { {dummy_buff, 0} };
|
||||
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
client_ipc_tests_call(handle, iovec_temp, 1, 0, NULL, 0);
|
||||
|
||||
|
@ -188,7 +181,7 @@ void in_len_0_in_vec_not_NULL()
|
|||
uint8_t dummy_buff[] = {1, 2, 3, 4, 5};
|
||||
psa_invec iovec_temp[1] = { {dummy_buff, sizeof(dummy_buff)} };
|
||||
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
client_ipc_tests_call(handle, iovec_temp, 0, 0, NULL, 0);
|
||||
|
||||
|
@ -205,7 +198,7 @@ void out_len_0_outvec_not_NULL()
|
|||
|
||||
uint8_t dummy_buff[] = {1, 2, 3, 4, 5};
|
||||
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
psa_invec in_vec_temp[2] = { {dummy_buff, sizeof(dummy_buff)},
|
||||
{dummy_buff, sizeof(dummy_buff)}
|
||||
|
@ -221,7 +214,7 @@ void out_len_0_outvec_not_NULL()
|
|||
//Testing rx_buff sent as NULL and rx_len as 0
|
||||
void rx_buff_null()
|
||||
{
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
uint8_t expect_size = 0, off = 2;
|
||||
|
||||
|
@ -241,7 +234,7 @@ void rx_buff_null()
|
|||
//Testing tx_buff sent as NULL and tx_len as 0
|
||||
void tx_buff_null()
|
||||
{
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
client_ipc_tests_call(handle, NULL, 0, CLIENT_RSP_BUF_SIZE, NULL, 0);
|
||||
|
||||
|
@ -251,7 +244,7 @@ void tx_buff_null()
|
|||
//Testing rx_buff and tx_null sent as NULL and rx_len and tx_len as 0
|
||||
void rx_tx_null()
|
||||
{
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
client_ipc_tests_call(handle, NULL, 0, 0, NULL, 0);
|
||||
|
||||
|
@ -261,7 +254,7 @@ void rx_tx_null()
|
|||
//Testing multiple subsequent calls to the same SID
|
||||
void multiple_call()
|
||||
{
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
uint8_t expect_size = 2, off = 2;
|
||||
|
||||
|
@ -304,7 +297,7 @@ static void set_struct(th_struct_t *thr_attr, psa_handle_t handle, psa_invec *io
|
|||
|
||||
static void call_diff_handle(th_struct_t *thr_attr)
|
||||
{
|
||||
psa_handle_t handle = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
|
||||
client_ipc_tests_call(handle,
|
||||
thr_attr->iovec_temp,
|
||||
|
@ -400,9 +393,9 @@ void exceed_num_of_max_channels()
|
|||
|
||||
for (i = 0; i < MBED_CONF_SPM_IPC_MAX_NUM_OF_CHANNELS + 1; i++) {
|
||||
if (i != MBED_CONF_SPM_IPC_MAX_NUM_OF_CHANNELS) {
|
||||
handle[i] = client_ipc_tests_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
handle[i] = client_ipc_tests_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
} else {
|
||||
handle[i] = psa_connect(PART1_ROT_SRV1, MINOR_VER);
|
||||
handle[i] = psa_connect(CLIENT_TESTS_PART1_ROT_SRV1, MINOR_VER);
|
||||
TEST_ASSERT_EQUAL_INT32(PSA_CONNECTION_REFUSED, handle[i]);
|
||||
}
|
||||
}
|
||||
|
@ -419,7 +412,7 @@ void client_close_null_handle()
|
|||
|
||||
void drop_connection()
|
||||
{
|
||||
psa_handle_t handle = client_ipc_tests_connect(DROP_CONN, DROP_CONN_MINOR_VER);
|
||||
psa_handle_t handle = client_ipc_tests_connect(CLIENT_TESTS_PART1_DROP_CONN, DROP_CONN_MINOR_VER);
|
||||
psa_status_t status = psa_call(handle, NULL, 0, NULL, 0);
|
||||
TEST_ASSERT_EQUAL_INT(PSA_DROP_CONNECTION, status);
|
||||
|
||||
|
@ -438,7 +431,7 @@ void verify_psa_framework_version()
|
|||
|
||||
void psa_version_existing()
|
||||
{
|
||||
uint32_t rot_version = psa_version(DROP_CONN);
|
||||
uint32_t rot_version = psa_version(CLIENT_TESTS_PART1_DROP_CONN);
|
||||
TEST_ASSERT_EQUAL_INT(DROP_CONN_MINOR_VER, rot_version);
|
||||
}
|
||||
|
||||
|
@ -450,7 +443,7 @@ void psa_version_non_existing()
|
|||
|
||||
void psa_version_secure_access_only()
|
||||
{
|
||||
uint32_t rot_version = psa_version(SECURE_CLIENTS_ONLY);
|
||||
uint32_t rot_version = psa_version(CLIENT_TESTS_PART1_SECURE_CLIENTS_ONLY);
|
||||
TEST_ASSERT_EQUAL_INT(PSA_VERSION_NONE, rot_version);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,13 +29,6 @@
|
|||
#include "spm_panic.h"
|
||||
#include "spm_internal.h"
|
||||
#include "psa_client_tests_part1_partition.h"
|
||||
|
||||
#ifndef USE_PSA_TEST_PARTITIONS
|
||||
#define USE_PSA_TEST_PARTITIONS
|
||||
#endif
|
||||
#ifndef USE_CLIENT_TESTS_PART1
|
||||
#define USE_CLIENT_TESTS_PART1
|
||||
#endif
|
||||
#include "psa_manifest/sid.h"
|
||||
|
||||
|
||||
|
@ -60,7 +53,7 @@ osThreadAttr_t client_tests_part1_thread_attr = {
|
|||
|
||||
spm_rot_service_t client_tests_part1_rot_services[CLIENT_TESTS_PART1_ROT_SRV_COUNT] = {
|
||||
{
|
||||
.sid = PART1_ROT_SRV1,
|
||||
.sid = CLIENT_TESTS_PART1_ROT_SRV1,
|
||||
.mask = PART1_ROT_SRV1_MSK,
|
||||
.partition = NULL,
|
||||
.min_version = 5,
|
||||
|
@ -72,7 +65,7 @@ spm_rot_service_t client_tests_part1_rot_services[CLIENT_TESTS_PART1_ROT_SRV_COU
|
|||
}
|
||||
},
|
||||
{
|
||||
.sid = DROP_CONN,
|
||||
.sid = CLIENT_TESTS_PART1_DROP_CONN,
|
||||
.mask = DROP_CONN_MSK,
|
||||
.partition = NULL,
|
||||
.min_version = 5,
|
||||
|
@ -84,7 +77,7 @@ spm_rot_service_t client_tests_part1_rot_services[CLIENT_TESTS_PART1_ROT_SRV_COU
|
|||
}
|
||||
},
|
||||
{
|
||||
.sid = SECURE_CLIENTS_ONLY,
|
||||
.sid = CLIENT_TESTS_PART1_SECURE_CLIENTS_ONLY,
|
||||
.mask = SECURE_CLIENTS_ONLY_MSK,
|
||||
.partition = NULL,
|
||||
.min_version = 5,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"stack_size": "0x400",
|
||||
"heap_size": "0x400",
|
||||
"services": [{
|
||||
"name": "PART1_ROT_SRV1",
|
||||
"name": "CLIENT_TESTS_PART1_ROT_SRV1",
|
||||
"identifier": "0x00001A05",
|
||||
"signal": "PART1_ROT_SRV1_MSK",
|
||||
"non_secure_clients": true,
|
||||
|
@ -15,7 +15,7 @@
|
|||
"minor_policy": "RELAXED"
|
||||
},
|
||||
{
|
||||
"name": "DROP_CONN",
|
||||
"name": "CLIENT_TESTS_PART1_DROP_CONN",
|
||||
"identifier": "0x00001A06",
|
||||
"signal": "DROP_CONN_MSK",
|
||||
"non_secure_clients": true,
|
||||
|
@ -23,7 +23,7 @@
|
|||
"minor_policy": "RELAXED"
|
||||
},
|
||||
{
|
||||
"name": "SECURE_CLIENTS_ONLY",
|
||||
"name": "CLIENT_TESTS_PART1_SECURE_CLIENTS_ONLY",
|
||||
"identifier": "0x00001A07",
|
||||
"signal": "SECURE_CLIENTS_ONLY_MSK",
|
||||
"non_secure_clients": false,
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
#ifndef PSA_CLIENT_TESTS_PART1_PARTITION_ROT_SERVICES_H
|
||||
#define PSA_CLIENT_TESTS_PART1_PARTITION_ROT_SERVICES_H
|
||||
|
||||
#define PART1_ROT_SRV1 0x00001A05
|
||||
#define DROP_CONN 0x00001A06
|
||||
#define SECURE_CLIENTS_ONLY 0x00001A07
|
||||
#define CLIENT_TESTS_PART1_ROT_SRV1 0x00001A05
|
||||
#define CLIENT_TESTS_PART1_DROP_CONN 0x00001A06
|
||||
#define CLIENT_TESTS_PART1_SECURE_CLIENTS_ONLY 0x00001A07
|
||||
|
||||
#endif // PSA_CLIENT_TESTS_PART1_PARTITION_ROT_SERVICES_H
|
||||
|
|
|
@ -25,16 +25,6 @@
|
|||
#include "utest.h"
|
||||
#include "psa/client.h"
|
||||
#include "server_tests.h"
|
||||
|
||||
#ifndef USE_PSA_TEST_PARTITIONS
|
||||
#define USE_PSA_TEST_PARTITIONS
|
||||
#endif
|
||||
#ifndef USE_SERVER_TESTS_PART1
|
||||
#define USE_SERVER_TESTS_PART1
|
||||
#endif
|
||||
#ifndef USE_SERVER_TESTS_PART2
|
||||
#define USE_SERVER_TESTS_PART2
|
||||
#endif
|
||||
#include "psa_manifest/sid.h"
|
||||
|
||||
#if defined(TARGET_TFM)
|
||||
|
@ -53,7 +43,7 @@ char cross_part_buf[] = "Hello and welcome SPM";
|
|||
|
||||
PSA_TEST_CLIENT(identity_during_connect)
|
||||
{
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT(test_handle > 0);
|
||||
|
||||
psa_close(test_handle);
|
||||
|
@ -63,7 +53,7 @@ PSA_TEST_CLIENT(identity_during_connect)
|
|||
PSA_TEST_CLIENT(identity_during_call)
|
||||
{
|
||||
psa_status_t status = PSA_SUCCESS;
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT(test_handle > 0);
|
||||
|
||||
status = psa_call(test_handle, NULL, 0, NULL, 0);
|
||||
|
@ -81,7 +71,7 @@ PSA_TEST_CLIENT(msg_size_assertion)
|
|||
{test_str + 13, 1},
|
||||
{NULL, 0}
|
||||
};
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT(test_handle > 0);
|
||||
|
||||
status = psa_call(test_handle, data, PSA_MAX_IOVEC, NULL, 0);
|
||||
|
@ -92,7 +82,7 @@ PSA_TEST_CLIENT(msg_size_assertion)
|
|||
|
||||
PSA_TEST_CLIENT(reject_connection)
|
||||
{
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT_EQUAL(PSA_CONNECTION_REFUSED, test_handle);
|
||||
}
|
||||
|
||||
|
@ -100,7 +90,7 @@ PSA_TEST_CLIENT(read_at_outofboud_offset)
|
|||
{
|
||||
psa_status_t status = PSA_SUCCESS;
|
||||
psa_invec data = { test_str, sizeof(test_str) };
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT(test_handle > 0);
|
||||
|
||||
status = psa_call(test_handle, &data, 1, NULL, 0);
|
||||
|
@ -117,7 +107,7 @@ PSA_TEST_CLIENT(msg_read_truncation)
|
|||
{test_str + 5, 6},
|
||||
{test_str + 13, 1}
|
||||
};
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT(test_handle > 0);
|
||||
|
||||
status = psa_call(test_handle, data, 3, NULL, 0);
|
||||
|
@ -130,7 +120,7 @@ PSA_TEST_CLIENT(skip_zero)
|
|||
{
|
||||
psa_status_t status = PSA_SUCCESS;
|
||||
psa_invec data = { test_str, sizeof(test_str) };
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT(test_handle > 0);
|
||||
|
||||
status = psa_call(test_handle, &data, 1, NULL, 0);
|
||||
|
@ -143,7 +133,7 @@ PSA_TEST_CLIENT(skip_some)
|
|||
{
|
||||
psa_status_t status = PSA_SUCCESS;
|
||||
psa_invec data = { test_str, sizeof(test_str) };
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT(test_handle > 0);
|
||||
|
||||
status = psa_call(test_handle, &data, 1, NULL, 0);
|
||||
|
@ -156,7 +146,7 @@ PSA_TEST_CLIENT(skip_more_than_left)
|
|||
{
|
||||
psa_status_t status = PSA_SUCCESS;
|
||||
psa_invec data = { test_str, 8 };
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT(test_handle > 0);
|
||||
|
||||
status = psa_call(test_handle, &data, 1, NULL, 0);
|
||||
|
@ -171,7 +161,7 @@ PSA_TEST_CLIENT(rhandle_factorial)
|
|||
uint32_t value = 1;
|
||||
psa_status_t status = PSA_SUCCESS;
|
||||
psa_outvec resp = { &secure_value, sizeof(secure_value) };
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT(test_handle > 0);
|
||||
|
||||
for (uint32_t i = 1; i <= 5; i++) {
|
||||
|
@ -186,7 +176,7 @@ PSA_TEST_CLIENT(rhandle_factorial)
|
|||
|
||||
PSA_TEST_CLIENT(cross_partition_call)
|
||||
{
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
size_t in_len = strlen(cross_part_buf);
|
||||
TEST_ASSERT_MESSAGE(test_handle > 0, "psa_connect() failed");
|
||||
|
||||
|
@ -206,7 +196,7 @@ PSA_TEST_CLIENT(cross_partition_call)
|
|||
// Test a common DOORBELL scenario
|
||||
PSA_TEST_CLIENT(doorbell_test)
|
||||
{
|
||||
psa_handle_t test_handle = psa_connect(TEST, TEST_ROT_SRV_MINOR);
|
||||
psa_handle_t test_handle = psa_connect(SERVER_TESTS_PART1_TEST, TEST_ROT_SRV_MINOR);
|
||||
TEST_ASSERT_MESSAGE(test_handle > 0, "psa_connect() failed");
|
||||
|
||||
psa_status_t status = psa_call(test_handle, NULL, 0, NULL, 0);
|
||||
|
@ -218,9 +208,9 @@ PSA_TEST_CLIENT(doorbell_test)
|
|||
|
||||
utest::v1::status_t spm_setup(const size_t number_of_cases)
|
||||
{
|
||||
control_handle = psa_connect(CONTROL, 0);
|
||||
control_handle = psa_connect(SERVER_TESTS_PART1_CONTROL, 0);
|
||||
if (control_handle < 0) {
|
||||
error("Could not open a connection with CONTROL ROT_SRV");
|
||||
error("Could not open a connection with SERVER_TESTS_PART1_CONTROL ROT_SRV");
|
||||
}
|
||||
|
||||
#ifndef NO_GREENTEA
|
||||
|
|
|
@ -56,7 +56,7 @@ void server_part1_main(void *ptr)
|
|||
switch (msg.type) {
|
||||
case PSA_IPC_CALL:
|
||||
if (msg.in_size[0] == 0) {
|
||||
SPM_PANIC("got a zero message size to CONTROL ROT_SRV\n");
|
||||
SPM_PANIC("got a zero message size to SERVER_TESTS_PART1_CONTROL ROT_SRV\n");
|
||||
}
|
||||
|
||||
if (psa_read(msg.handle, 0, &action, sizeof(action)) != sizeof(action)) {
|
||||
|
|
|
@ -20,20 +20,10 @@
|
|||
#include "psa/service.h"
|
||||
#include "psa_server_tests_part1_partition.h"
|
||||
#include "server_tests.h"
|
||||
|
||||
#ifndef USE_PSA_TEST_PARTITIONS
|
||||
#define USE_PSA_TEST_PARTITIONS
|
||||
#endif
|
||||
#ifndef USE_SERVER_TESTS_PART1
|
||||
#define USE_SERVER_TESTS_PART1
|
||||
#endif
|
||||
#ifndef USE_SERVER_TESTS_PART2
|
||||
#define USE_SERVER_TESTS_PART2
|
||||
#endif
|
||||
#include "psa_manifest/sid.h"
|
||||
|
||||
/**
|
||||
* Process a generic connect message to TEST ROT_SRV.
|
||||
* Process a generic connect message to SERVER_TESTS_PART1_TEST ROT_SRV.
|
||||
* @return PSA_SUCCESS or negative error code if failed.
|
||||
*/
|
||||
static psa_status_t process_connect_request(void)
|
||||
|
@ -59,7 +49,7 @@ static psa_status_t process_connect_request(void)
|
|||
}
|
||||
|
||||
/**
|
||||
* Process a generic disconnect message to TEST ROT_SRV.
|
||||
* Process a generic disconnect message to SERVER_TESTS_PART1_TEST ROT_SRV.
|
||||
* @return PSA_SUCCESS or negative error code if failed.
|
||||
*/
|
||||
static psa_status_t process_disconnect_request(void)
|
||||
|
@ -608,7 +598,7 @@ PSA_TEST_SERVER(cross_partition_call)
|
|||
psa_invec data = { buff, data_read };
|
||||
|
||||
psa_outvec resp = { buff, data_read };
|
||||
psa_handle_t conn_handle = psa_connect(ROT_SRV_REVERSE, 5);
|
||||
psa_handle_t conn_handle = psa_connect(SERVER_TESTS_PART2_ROT_SRV_REVERSE, 5);
|
||||
if (conn_handle <= 0) {
|
||||
partition_call_status = PSA_TEST_ERROR;
|
||||
}
|
||||
|
@ -662,7 +652,7 @@ PSA_TEST_SERVER(doorbell_test)
|
|||
}
|
||||
|
||||
// -- Connection with partition2 - START
|
||||
psa_handle_t conn_handle = psa_connect(ROT_SRV_DB_TST, 5);
|
||||
psa_handle_t conn_handle = psa_connect(SERVER_TESTS_PART2_ROT_SRV_DB_TST, 5);
|
||||
if (conn_handle <= 0) {
|
||||
partition_call_status = PSA_TEST_ERROR;
|
||||
}
|
||||
|
|
|
@ -29,16 +29,6 @@
|
|||
#include "spm_panic.h"
|
||||
#include "spm_internal.h"
|
||||
#include "psa_server_tests_part1_partition.h"
|
||||
|
||||
#ifndef USE_PSA_TEST_PARTITIONS
|
||||
#define USE_PSA_TEST_PARTITIONS
|
||||
#endif
|
||||
#ifndef USE_SERVER_TESTS_PART1
|
||||
#define USE_SERVER_TESTS_PART1
|
||||
#endif
|
||||
#ifndef USE_SERVER_TESTS_PART2
|
||||
#define USE_SERVER_TESTS_PART2
|
||||
#endif
|
||||
#include "psa_manifest/sid.h"
|
||||
|
||||
|
||||
|
@ -63,7 +53,7 @@ osThreadAttr_t server_tests_part1_thread_attr = {
|
|||
|
||||
spm_rot_service_t server_tests_part1_rot_services[SERVER_TESTS_PART1_ROT_SRV_COUNT] = {
|
||||
{
|
||||
.sid = CONTROL,
|
||||
.sid = SERVER_TESTS_PART1_CONTROL,
|
||||
.mask = CONTROL_MSK,
|
||||
.partition = NULL,
|
||||
.min_version = 5,
|
||||
|
@ -75,7 +65,7 @@ spm_rot_service_t server_tests_part1_rot_services[SERVER_TESTS_PART1_ROT_SRV_COU
|
|||
}
|
||||
},
|
||||
{
|
||||
.sid = TEST,
|
||||
.sid = SERVER_TESTS_PART1_TEST,
|
||||
.mask = TEST_MSK,
|
||||
.partition = NULL,
|
||||
.min_version = 12,
|
||||
|
@ -90,8 +80,8 @@ spm_rot_service_t server_tests_part1_rot_services[SERVER_TESTS_PART1_ROT_SRV_COU
|
|||
|
||||
/* External SIDs used by SERVER_TESTS_PART1 */
|
||||
const uint32_t server_tests_part1_external_sids[2] = {
|
||||
ROT_SRV_REVERSE,
|
||||
ROT_SRV_DB_TST,
|
||||
SERVER_TESTS_PART2_ROT_SRV_REVERSE,
|
||||
SERVER_TESTS_PART2_ROT_SRV_DB_TST,
|
||||
};
|
||||
|
||||
static osRtxMutex_t server_tests_part1_mutex = {0};
|
||||
|
|
|
@ -29,16 +29,6 @@
|
|||
#include "spm_panic.h"
|
||||
#include "spm_internal.h"
|
||||
#include "psa_server_tests_part2_partition.h"
|
||||
|
||||
#ifndef USE_PSA_TEST_PARTITIONS
|
||||
#define USE_PSA_TEST_PARTITIONS
|
||||
#endif
|
||||
#ifndef USE_SERVER_TESTS_PART1
|
||||
#define USE_SERVER_TESTS_PART1
|
||||
#endif
|
||||
#ifndef USE_SERVER_TESTS_PART2
|
||||
#define USE_SERVER_TESTS_PART2
|
||||
#endif
|
||||
#include "psa_manifest/sid.h"
|
||||
|
||||
|
||||
|
@ -63,7 +53,7 @@ osThreadAttr_t server_tests_part2_thread_attr = {
|
|||
|
||||
spm_rot_service_t server_tests_part2_rot_services[SERVER_TESTS_PART2_ROT_SRV_COUNT] = {
|
||||
{
|
||||
.sid = ROT_SRV_REVERSE,
|
||||
.sid = SERVER_TESTS_PART2_ROT_SRV_REVERSE,
|
||||
.mask = ROT_SRV_REVERSE_MSK,
|
||||
.partition = NULL,
|
||||
.min_version = 5,
|
||||
|
@ -75,7 +65,7 @@ spm_rot_service_t server_tests_part2_rot_services[SERVER_TESTS_PART2_ROT_SRV_COU
|
|||
}
|
||||
},
|
||||
{
|
||||
.sid = ROT_SRV_DB_TST,
|
||||
.sid = SERVER_TESTS_PART2_ROT_SRV_DB_TST,
|
||||
.mask = ROT_SRV_DB_TST_MSK,
|
||||
.partition = NULL,
|
||||
.min_version = 5,
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#ifndef PSA_SERVER_TESTS_PART1_PARTITION_ROT_SERVICES_H
|
||||
#define PSA_SERVER_TESTS_PART1_PARTITION_ROT_SERVICES_H
|
||||
|
||||
#define CONTROL 0x00001A01
|
||||
#define TEST 0x00001A02
|
||||
#define SERVER_TESTS_PART1_CONTROL 0x00001A01
|
||||
#define SERVER_TESTS_PART1_TEST 0x00001A02
|
||||
|
||||
#endif // PSA_SERVER_TESTS_PART1_PARTITION_ROT_SERVICES_H
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#ifndef PSA_SERVER_TESTS_PART2_PARTITION_ROT_SERVICES_H
|
||||
#define PSA_SERVER_TESTS_PART2_PARTITION_ROT_SERVICES_H
|
||||
|
||||
#define ROT_SRV_REVERSE 0x00001A03
|
||||
#define ROT_SRV_DB_TST 0x00001A04
|
||||
#define SERVER_TESTS_PART2_ROT_SRV_REVERSE 0x00001A03
|
||||
#define SERVER_TESTS_PART2_ROT_SRV_DB_TST 0x00001A04
|
||||
|
||||
#endif // PSA_SERVER_TESTS_PART2_PARTITION_ROT_SERVICES_H
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"stack_size": "0x400",
|
||||
"heap_size": "0x400",
|
||||
"services": [{
|
||||
"name": "CONTROL",
|
||||
"name": "SERVER_TESTS_PART1_CONTROL",
|
||||
"identifier": "0x00001A01",
|
||||
"signal": "CONTROL_MSK",
|
||||
"non_secure_clients": true,
|
||||
|
@ -15,7 +15,7 @@
|
|||
"minor_policy": "RELAXED"
|
||||
},
|
||||
{
|
||||
"name": "TEST",
|
||||
"name": "SERVER_TESTS_PART1_TEST",
|
||||
"identifier": "0x00001A02",
|
||||
"signal": "TEST_MSK",
|
||||
"non_secure_clients": true,
|
||||
|
@ -24,8 +24,8 @@
|
|||
}
|
||||
],
|
||||
"extern_sids": [
|
||||
"ROT_SRV_REVERSE",
|
||||
"ROT_SRV_DB_TST"
|
||||
"SERVER_TESTS_PART2_ROT_SRV_REVERSE",
|
||||
"SERVER_TESTS_PART2_ROT_SRV_DB_TST"
|
||||
],
|
||||
"source_files": [
|
||||
"COMPONENT_SPE/server_tests_partition1.c",
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"stack_size": "0x400",
|
||||
"heap_size": "0x400",
|
||||
"services": [{
|
||||
"name": "ROT_SRV_REVERSE",
|
||||
"name": "SERVER_TESTS_PART2_ROT_SRV_REVERSE",
|
||||
"identifier": "0x00001A03",
|
||||
"signal": "ROT_SRV_REVERSE_MSK",
|
||||
"non_secure_clients": false,
|
||||
|
@ -15,7 +15,7 @@
|
|||
"minor_policy": "STRICT"
|
||||
},
|
||||
{
|
||||
"name": "ROT_SRV_DB_TST",
|
||||
"name": "SERVER_TESTS_PART2_ROT_SRV_DB_TST",
|
||||
"identifier": "0x00001A04",
|
||||
"signal": "ROT_SRV_DB_TST_MSK",
|
||||
"non_secure_clients": false,
|
||||
|
|
|
@ -26,13 +26,6 @@
|
|||
#include "unity.h"
|
||||
#include "utest.h"
|
||||
#include "psa/client.h"
|
||||
|
||||
#ifndef USE_PSA_TEST_PARTITIONS
|
||||
#define USE_PSA_TEST_PARTITIONS
|
||||
#endif
|
||||
#ifndef USE_SMOKE_TESTS_PART1
|
||||
#define USE_SMOKE_TESTS_PART1
|
||||
#endif
|
||||
#include "psa_manifest/sid.h"
|
||||
|
||||
#if defined(TARGET_TFM)
|
||||
|
@ -55,7 +48,7 @@ char msg_buf[] = CLIENT_TX_MSG;
|
|||
|
||||
void example_main(void)
|
||||
{
|
||||
psa_handle_t conn_handle = psa_connect(ROT_SRV1, CLIENT_MINOR_VERSION);
|
||||
psa_handle_t conn_handle = psa_connect(SMOKE_TESTS_PART1_ROT_SRV1, CLIENT_MINOR_VERSION);
|
||||
TEST_ASSERT_MESSAGE(conn_handle > 0, "psa_connect() failed");
|
||||
|
||||
|
||||
|
|
|
@ -29,13 +29,6 @@
|
|||
#include "spm_panic.h"
|
||||
#include "spm_internal.h"
|
||||
#include "psa_smoke_tests_part1_partition.h"
|
||||
|
||||
#ifndef USE_PSA_TEST_PARTITIONS
|
||||
#define USE_PSA_TEST_PARTITIONS
|
||||
#endif
|
||||
#ifndef USE_SMOKE_TESTS_PART1
|
||||
#define USE_SMOKE_TESTS_PART1
|
||||
#endif
|
||||
#include "psa_manifest/sid.h"
|
||||
|
||||
|
||||
|
@ -60,7 +53,7 @@ osThreadAttr_t smoke_tests_part1_thread_attr = {
|
|||
|
||||
spm_rot_service_t smoke_tests_part1_rot_services[SMOKE_TESTS_PART1_ROT_SRV_COUNT] = {
|
||||
{
|
||||
.sid = ROT_SRV1,
|
||||
.sid = SMOKE_TESTS_PART1_ROT_SRV1,
|
||||
.mask = ROT_SRV1_MSK,
|
||||
.partition = NULL,
|
||||
.min_version = 5,
|
||||
|
|
|
@ -26,6 +26,6 @@
|
|||
#ifndef PSA_SMOKE_TESTS_PART1_PARTITION_ROT_SERVICES_H
|
||||
#define PSA_SMOKE_TESTS_PART1_PARTITION_ROT_SERVICES_H
|
||||
|
||||
#define ROT_SRV1 0x00001A00
|
||||
#define SMOKE_TESTS_PART1_ROT_SRV1 0x00001A00
|
||||
|
||||
#endif // PSA_SMOKE_TESTS_PART1_PARTITION_ROT_SERVICES_H
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"stack_size": "0x200",
|
||||
"heap_size": "0x400",
|
||||
"services": [{
|
||||
"name": "ROT_SRV1",
|
||||
"name": "SMOKE_TESTS_PART1_ROT_SRV1",
|
||||
"identifier": "0x00001A00",
|
||||
"signal": "ROT_SRV1_MSK",
|
||||
"non_secure_clients": true,
|
||||
|
|
|
@ -39,26 +39,26 @@
|
|||
|
||||
#ifdef USE_CLIENT_TESTS_PART1
|
||||
/******** CLIENT_TESTS_PART1 ********/
|
||||
{"PART1_ROT_SRV1", CLIENT_TESTS_PART1_ID, PART1_ROT_SRV1_MSK, 0x00001A05, true, 5, TFM_VERSION_POLICY_RELAXED},
|
||||
{"DROP_CONN", CLIENT_TESTS_PART1_ID, DROP_CONN_MSK, 0x00001A06, true, 5, TFM_VERSION_POLICY_RELAXED},
|
||||
{"SECURE_CLIENTS_ONLY", CLIENT_TESTS_PART1_ID, SECURE_CLIENTS_ONLY_MSK, 0x00001A07, false, 5, TFM_VERSION_POLICY_RELAXED},
|
||||
{"CLIENT_TESTS_PART1_ROT_SRV1", CLIENT_TESTS_PART1_ID, PART1_ROT_SRV1_MSK, 0x00001A05, true, 5, TFM_VERSION_POLICY_RELAXED},
|
||||
{"CLIENT_TESTS_PART1_DROP_CONN", CLIENT_TESTS_PART1_ID, DROP_CONN_MSK, 0x00001A06, true, 5, TFM_VERSION_POLICY_RELAXED},
|
||||
{"CLIENT_TESTS_PART1_SECURE_CLIENTS_ONLY", CLIENT_TESTS_PART1_ID, SECURE_CLIENTS_ONLY_MSK, 0x00001A07, false, 5, TFM_VERSION_POLICY_RELAXED},
|
||||
#endif // USE_CLIENT_TESTS_PART1
|
||||
|
||||
#ifdef USE_SERVER_TESTS_PART1
|
||||
/******** SERVER_TESTS_PART1 ********/
|
||||
{"CONTROL", SERVER_TESTS_PART1_ID, CONTROL_MSK, 0x00001A01, true, 5, TFM_VERSION_POLICY_RELAXED},
|
||||
{"TEST", SERVER_TESTS_PART1_ID, TEST_MSK, 0x00001A02, true, 12, TFM_VERSION_POLICY_STRICT},
|
||||
{"SERVER_TESTS_PART1_CONTROL", SERVER_TESTS_PART1_ID, CONTROL_MSK, 0x00001A01, true, 5, TFM_VERSION_POLICY_RELAXED},
|
||||
{"SERVER_TESTS_PART1_TEST", SERVER_TESTS_PART1_ID, TEST_MSK, 0x00001A02, true, 12, TFM_VERSION_POLICY_STRICT},
|
||||
#endif // USE_SERVER_TESTS_PART1
|
||||
|
||||
#ifdef USE_SERVER_TESTS_PART2
|
||||
/******** SERVER_TESTS_PART2 ********/
|
||||
{"ROT_SRV_REVERSE", SERVER_TESTS_PART2_ID, ROT_SRV_REVERSE_MSK, 0x00001A03, false, 5, TFM_VERSION_POLICY_STRICT},
|
||||
{"ROT_SRV_DB_TST", SERVER_TESTS_PART2_ID, ROT_SRV_DB_TST_MSK, 0x00001A04, false, 5, TFM_VERSION_POLICY_STRICT},
|
||||
{"SERVER_TESTS_PART2_ROT_SRV_REVERSE", SERVER_TESTS_PART2_ID, ROT_SRV_REVERSE_MSK, 0x00001A03, false, 5, TFM_VERSION_POLICY_STRICT},
|
||||
{"SERVER_TESTS_PART2_ROT_SRV_DB_TST", SERVER_TESTS_PART2_ID, ROT_SRV_DB_TST_MSK, 0x00001A04, false, 5, TFM_VERSION_POLICY_STRICT},
|
||||
#endif // USE_SERVER_TESTS_PART2
|
||||
|
||||
#ifdef USE_SMOKE_TESTS_PART1
|
||||
/******** SMOKE_TESTS_PART1 ********/
|
||||
{"ROT_SRV1", SMOKE_TESTS_PART1_ID, ROT_SRV1_MSK, 0x00001A00, true, 5, TFM_VERSION_POLICY_RELAXED},
|
||||
{"SMOKE_TESTS_PART1_ROT_SRV1", SMOKE_TESTS_PART1_ID, ROT_SRV1_MSK, 0x00001A00, true, 5, TFM_VERSION_POLICY_RELAXED},
|
||||
#endif // USE_SMOKE_TESTS_PART1
|
||||
|
||||
#endif // USE_PSA_TEST_PARTITIONS
|
||||
|
|
|
@ -44,28 +44,20 @@
|
|||
|
||||
/*************************** Test Partitions *********************************/
|
||||
|
||||
#ifdef USE_PSA_TEST_PARTITIONS
|
||||
// CLIENT_TESTS_PART1
|
||||
#define CLIENT_TESTS_PART1_ROT_SRV1 0x00001A05
|
||||
#define CLIENT_TESTS_PART1_DROP_CONN 0x00001A06
|
||||
#define CLIENT_TESTS_PART1_SECURE_CLIENTS_ONLY 0x00001A07
|
||||
|
||||
#ifdef USE_CLIENT_TESTS_PART1
|
||||
#define PART1_ROT_SRV1 0x00001A05
|
||||
#define DROP_CONN 0x00001A06
|
||||
#define SECURE_CLIENTS_ONLY 0x00001A07
|
||||
#endif
|
||||
// SERVER_TESTS_PART1
|
||||
#define SERVER_TESTS_PART1_CONTROL 0x00001A01
|
||||
#define SERVER_TESTS_PART1_TEST 0x00001A02
|
||||
|
||||
#ifdef USE_SERVER_TESTS_PART1
|
||||
#define CONTROL 0x00001A01
|
||||
#define TEST 0x00001A02
|
||||
#endif
|
||||
// SERVER_TESTS_PART2
|
||||
#define SERVER_TESTS_PART2_ROT_SRV_REVERSE 0x00001A03
|
||||
#define SERVER_TESTS_PART2_ROT_SRV_DB_TST 0x00001A04
|
||||
|
||||
#ifdef USE_SERVER_TESTS_PART2
|
||||
#define ROT_SRV_REVERSE 0x00001A03
|
||||
#define ROT_SRV_DB_TST 0x00001A04
|
||||
#endif
|
||||
|
||||
#ifdef USE_SMOKE_TESTS_PART1
|
||||
#define ROT_SRV1 0x00001A00
|
||||
#endif
|
||||
|
||||
#endif // USE_PSA_TEST_PARTITIONS
|
||||
// SMOKE_TESTS_PART1
|
||||
#define SMOKE_TESTS_PART1_ROT_SRV1 0x00001A00
|
||||
|
||||
#endif // SID_H
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// ---------------------------------- Includes ---------------------------------
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include "psa/service.h"
|
||||
#include "psa/client.h"
|
||||
#include "psa/service.h"
|
||||
|
||||
|
||||
#define PSA_CRYPTO_SECURE 1
|
||||
|
|
|
@ -30,17 +30,12 @@
|
|||
|
||||
/*************************** Test Partitions *********************************/
|
||||
|
||||
#ifdef USE_PSA_TEST_PARTITIONS
|
||||
|
||||
{% for partition in test_partitions %}
|
||||
#ifdef USE_{{partition.name|upper}}
|
||||
// {{partition.name|upper}}
|
||||
{% for rot_srv in partition.rot_services %}
|
||||
#define {{rot_srv.name|upper}} {{rot_srv.id}}
|
||||
{% endfor %}
|
||||
#endif
|
||||
|
||||
{% endfor %}
|
||||
#endif // USE_PSA_TEST_PARTITIONS
|
||||
|
||||
#endif // SID_H
|
||||
{# End of file #}
|
||||
|
|
Loading…
Reference in New Issue