diff options
author | Max Shvetsov <maksims.svecovs@arm.com> | 2021-02-23 18:29:14 +0000 |
---|---|---|
committer | Maksims Svecovs <maksims.svecovs@arm.com> | 2021-07-15 16:40:25 +0100 |
commit | 461bac060aa979e651a06b5256757aeb9b639aae (patch) | |
tree | d150ad0d07ffe81440e81ca794534ae5b76e45e0 | |
parent | 0b7d25f4add710ba13f4f46c54f8fe23a01ed053 (diff) | |
download | tf-a-tests-461bac060aa979e651a06b5256757aeb9b639aae.tar.gz |
fix(tftf): test ffa_partition_info_get from NWd
Test if the normal world can get partition information of SPs. Testing
for both individual partition information as well as information for
all deployed SPs.
Signed-off-by: Max Shvetsov <maksims.svecovs@arm.com>
Change-Id: I4bc061c2658a10e6925eb9f621930edb703b0f10
-rw-r--r-- | tftf/tests/runtime_services/secure_service/test_ffa_setup_and_discovery.c | 72 | ||||
-rw-r--r-- | tftf/tests/tests-spm.xml | 3 |
2 files changed, 74 insertions, 1 deletions
diff --git a/tftf/tests/runtime_services/secure_service/test_ffa_setup_and_discovery.c b/tftf/tests/runtime_services/secure_service/test_ffa_setup_and_discovery.c index f8a5ace57..572db9859 100644 --- a/tftf/tests/runtime_services/secure_service/test_ffa_setup_and_discovery.c +++ b/tftf/tests/runtime_services/secure_service/test_ffa_setup_and_discovery.c @@ -6,8 +6,9 @@ #include <debug.h> -#include <ffa_svc.h> +#include <ffa_endpoints.h> #include <ffa_helpers.h> +#include <ffa_svc.h> #include <spm_common.h> #include <test_helpers.h> #include <tftf_lib.h> @@ -17,6 +18,38 @@ static bool should_skip_version_test; static struct mailbox_buffers mb; +static const struct ffa_uuid sp_uuids[] = { + {PRIMARY_UUID}, {SECONDARY_UUID}, {TERTIARY_UUID} + }; +static const struct ffa_uuid null_uuid = { .uuid = {0} }; + +static const struct ffa_partition_info ffa_expected_partition_info[] = { + /* Primary partition info */ + { + .id = SP_ID(1), + .exec_context = PRIMARY_EXEC_CTX_COUNT, + .properties = FFA_PARTITION_DIRECT_REQ_RECV + }, + /* Secondary partition info */ + { + .id = SP_ID(2), + .exec_context = SECONDARY_EXEC_CTX_COUNT, + .properties = FFA_PARTITION_DIRECT_REQ_RECV + }, + /* Tertiary partition info */ + { + .id = SP_ID(3), + .exec_context = TERTIARY_EXEC_CTX_COUNT, + .properties = FFA_PARTITION_DIRECT_REQ_RECV + }, + /* Ivy partition info */ + { + .id = SP_ID(4), + .exec_context = IVY_EXEC_CTX_COUNT, + .properties = FFA_PARTITION_DIRECT_REQ_RECV + } +}; + /* * Using FFA version expected for SPM. */ @@ -239,3 +272,40 @@ test_result_t test_ffa_spm_id_get(void) return TEST_RESULT_SUCCESS; } + +/****************************************************************************** + * FF-A PARTITION_INFO_GET ABI Tests + ******************************************************************************/ + +/** + * Attempt to get the SP partition information for individual partitions as well + * as all secure partitions. + */ +test_result_t test_ffa_partition_info(void) +{ + /*********************************************************************** + * Check if SPMC has ffa_version and expected FFA endpoints are deployed. + **********************************************************************/ + CHECK_SPMC_TESTING_SETUP(1, 0, sp_uuids); + + GET_TFTF_MAILBOX(mb); + + if (!ffa_partition_info_helper(&mb, sp_uuids[0], + &ffa_expected_partition_info[0], 1)) { + return TEST_RESULT_FAIL; + } + if (!ffa_partition_info_helper(&mb, sp_uuids[1], + &ffa_expected_partition_info[1], 1)) { + return TEST_RESULT_FAIL; + } + if (!ffa_partition_info_helper(&mb, sp_uuids[2], + &ffa_expected_partition_info[2], 1)) { + return TEST_RESULT_FAIL; + } + if (!ffa_partition_info_helper(&mb, null_uuid, + ffa_expected_partition_info, 4)) { + return TEST_RESULT_FAIL; + } + + return TEST_RESULT_SUCCESS; +}
\ No newline at end of file diff --git a/tftf/tests/tests-spm.xml b/tftf/tests/tests-spm.xml index ea76778f2..360e32d70 100644 --- a/tftf/tests/tests-spm.xml +++ b/tftf/tests/tests-spm.xml @@ -28,6 +28,9 @@ <testcase name="Test FFA_SPM_ID_GET" function="test_ffa_spm_id_get" /> + + <testcase name="Test FFA_PARTITION_INFO_GET" + function="test_ffa_partition_info" /> </testsuite> <testsuite name="FF-A Direct messaging" |