Doc: Refine descriptions of test services
There have been some changes in the structure of test services and
test suites. The paths and how to implement a new test service
need to be updated.
Signed-off-by: Jianliang Shen <jianliang.shen@arm.com>
Change-Id: Ic83820d855b2c4cfbbd04cdac28b54904665db53
diff --git a/docs/integration_guide/services/tfm_attestation_integration_guide.rst b/docs/integration_guide/services/tfm_attestation_integration_guide.rst
index c06409d..6ad995a 100644
--- a/docs/integration_guide/services/tfm_attestation_integration_guide.rst
+++ b/docs/integration_guide/services/tfm_attestation_integration_guide.rst
@@ -587,13 +587,13 @@
===============
The initial attestation token is verified by the attestation test suite in
-``test/suites/attestation``. The test suite is responsible for verifying the
-token signature and parsing the token to verify its encoding and the presence of
-the mandatory claims. This test suite can be executed on the device. It is part
-of the regression test suite. The test suite is configurable in the
-``test/suites/attestation/attest_token_test_values.h`` header file. In this file
-there are two attributes for each claim which are configurable (more details
-in the header file):
+``test/secure_fw/suites/attestation``. The test suite is responsible for
+verifying the token signature and parsing the token to verify its encoding and
+the presence of the mandatory claims. This test suite can be executed on the
+device. It is part of the regression test suite. The test suite is configurable
+in the ``test/secure_fw/suites/attestation/attest_token_test_values.h`` header
+file. In this file there are two attributes for each claim which are
+configurable (more details in the header file):
- Requirements of presence: optional or mandatory
- Expected value: Value check can be disabled or expected value can be provided
@@ -631,7 +631,7 @@
:doc:`tfm_build_instruction </docs/technical_references/instructions/tfm_build_instruction>`.
- Lunch FVP model in DS-5. More info in
:doc:`Run TF-M examples on Arm platforms </docs/technical_references/instructions/run_tfm_examples_on_arm_platforms>`.
- - Set a breakpoint in ``test/suites/attestation/attest_token_test.c``
+ - Set a breakpoint in ``test/secure_fw/suites/attestation/attest_token_test.c``
in ``decode_test_internal(..)`` after the ``token_main_alt(..)`` returned,
i.e. on line 859. Execute the code in the model until the breakpoint hits
second time. At this point the console prints the test case name:
@@ -666,4 +666,4 @@
--------------
-*Copyright (c) 2018-2021, Arm Limited. All rights reserved.*
+*Copyright (c) 2018-2022, Arm Limited. All rights reserved.*
diff --git a/docs/integration_guide/services/tfm_ps_integration_guide.rst b/docs/integration_guide/services/tfm_ps_integration_guide.rst
index 11a144e..4ef565d 100644
--- a/docs/integration_guide/services/tfm_ps_integration_guide.rst
+++ b/docs/integration_guide/services/tfm_ps_integration_guide.rst
@@ -369,8 +369,8 @@
object table is allocated statically as PS does not use dynamic memory
allocation.
- ``PS_TEST_NV_COUNTERS``- this flag enables the virtual implementation of the
- PS NV counters interface in ``test/suites/ps/secure/nv_counters`` of the
- ``tf-m-tests`` repo, which emulates NV counters in
+ PS NV counters interface in ``test/secure_fw/suites/ps/secure/nv_counters`` of
+ the ``tf-m-tests`` repo, which emulates NV counters in
RAM, and disables the hardware implementation of NV counters provided by
the secure service. This flag is enabled by default, but has no effect when
the secure regression test is disabled. This flag can be
@@ -386,5 +386,5 @@
--------------
-*Copyright (c) 2018-2021, Arm Limited. All rights reserved.*
+*Copyright (c) 2018-2022, Arm Limited. All rights reserved.*
*Copyright (c) 2020, Cypress Semiconductor Corporation. All rights reserved.*
diff --git a/docs/integration_guide/services/tfm_secure_partition_addition.rst b/docs/integration_guide/services/tfm_secure_partition_addition.rst
index 332414a..19bdbb5 100644
--- a/docs/integration_guide/services/tfm_secure_partition_addition.rst
+++ b/docs/integration_guide/services/tfm_secure_partition_addition.rst
@@ -174,7 +174,7 @@
==================================== ======================
Please refer to ``<TF-M base folder>/tools/tfm_manifest_list.yaml``,
-``<TF-M test repo>/test/test_services/tfm_test_manifest_list.yaml`` and
+``<TF-M test repo>/test/secure_fw/tfm_test_manifest_list.yaml`` and
``<TF-M base folder>/tools/tfm_psa_ff_test_manifest_list.yaml`` for the detailed
PID allocations.
@@ -558,7 +558,7 @@
---------------
To test that the service has been implemented correctly, the user needs to call
it from somewhere. One option is to create a new testsuite, such as
-``<TF-M-test base folder>/test/suites/example/non_secure/example_ns_
+``<TF-M-test base folder>/test/secure_fw/suites/example/non_secure/example_ns_
interface_testsuite.c``.
The process of adding test connection is explained in the specification
@@ -737,4 +737,4 @@
--------------
-*Copyright (c) 2019-2021, Arm Limited. All rights reserved.*
+*Copyright (c) 2019-2022, Arm Limited. All rights reserved.*
diff --git a/docs/integration_guide/tfm_secure_irq_integration_guide.rst b/docs/integration_guide/tfm_secure_irq_integration_guide.rst
index 16d5797..ac047bb 100644
--- a/docs/integration_guide/tfm_secure_irq_integration_guide.rst
+++ b/docs/integration_guide/tfm_secure_irq_integration_guide.rst
@@ -396,10 +396,10 @@
.. [2] `FF-M v1.1 Extention <https://documentation-service.arm.com/static/600067c09b9c2d1bb22cd1c5?token=>`__
-.. [3] https://git.trustedfirmware.org/TF-M/tf-m-tests.git/tree/test/test_services/tfm_flih_test_service
+.. [3] https://git.trustedfirmware.org/TF-M/tf-m-tests.git/tree/test/secure_fw/suites/spm/irq/service/tfm_flih_test_service
-.. [4] https://git.trustedfirmware.org/TF-M/tf-m-tests.git/tree/test/test_services/tfm_slih_test_service
+.. [4] https://git.trustedfirmware.org/TF-M/tf-m-tests.git/tree/test/secure_fw/suites/spm/irq/service/tfm_slih_test_service
--------------
-*Copyright (c) 2021, Arm Limited. All rights reserved.*
+*Copyright (c) 2021-2022, Arm Limited. All rights reserved.*
diff --git a/docs/integration_guide/tfm_test_suites_addition.rst b/docs/integration_guide/tfm_test_suites_addition.rst
index bd4c4a7..ccab714 100644
--- a/docs/integration_guide/tfm_test_suites_addition.rst
+++ b/docs/integration_guide/tfm_test_suites_addition.rst
@@ -22,17 +22,19 @@
TF-M tests source code are located in
`tf-m-tests <https://git.trustedfirmware.org/TF-M/tf-m-tests.git/>`__.
-+----------------+-------------------------------------------------------------+
-| Folder name | Description |
-+================+=============================================================+
-| test/config | The CMAKE test configurations files. |
-+----------------+-------------------------------------------------------------+
-| test/framework | Source code for test framework code, managing test suites. |
-+----------------+-------------------------------------------------------------+
-| test/suites | Test suites divided into subdirectories. |
-+----------------+-------------------------------------------------------------+
-| test/services | Test services divided into subdirectories. |
-+----------------+-------------------------------------------------------------+
++---------------------------------------+---------------------------------------------------------------+
+| Folder name | Description |
++=======================================+===============================================================+
+| test/config | The CMAKE test configurations files. |
++---------------------------------------+---------------------------------------------------------------+
+| test/framework | Source code for test framework code, managing test suites. |
++---------------------------------------+---------------------------------------------------------------+
+| test/secure_fw/suites | Test suites divided into subdirectories. |
++---------------------------------------+---------------------------------------------------------------+
+| test/secure_fw/suites/<suite>/service | Test service divided into corresponding suite subdirectories. |
++---------------------------------------+---------------------------------------------------------------+
+| test/secure_fw/common_test_services | Common test services. |
++---------------------------------------+---------------------------------------------------------------+
Test configuration
==================
@@ -61,10 +63,11 @@
Source code
===========
-The test suite example subdirectory named ``<test_name>`` is located under the path
-``tf-m-tests/test/suites``. If the new test suite includes both non-secure and
-secure parts, the source code shall be divided shared code and specific code.
-An example test suite folder can be organized as the figure below.
+The test suite example subdirectory named ``<test_name>`` is located under the
+path ``tf-m-tests/test/secure_fw/suites``. If the new test suite includes both
+non-secure and secure parts, the source code shall be divided shared code and
+specific code. An example test suite folder can be organized as the figure
+below.
.. code-block:: bash
@@ -143,7 +146,7 @@
===============================
The mission of test configurations is to control the build. They are applied
-in ``test/suites/<test_name>/CMakeLists.txt`` like the example below.
+in ``test/secure_fw/suites/<test_name>/CMakeLists.txt`` like the example below.
.. code-block:: cmake
@@ -218,7 +221,7 @@
On most platforms non-secure tests and secure tests run on the same CPU
core, but dual-core platform is an exception. So secure test library and
secure sevices shall be linked together in the file
- ``tf-m-tests/test/test_services/CMakeLists.txt``. Thus they can be built on
+ ``tf-m-tests/test/secure_fw/secure_tests.cmake``. Thus they can be built on
secure CPU core and non-secure tests library and RTOS are built on
non-secure CPU core.
@@ -245,7 +248,6 @@
TEST_FUN * const test; /*!< Test function to call */
const char *name; /*!< Test name */
const char *desc; /*!< Test description */
- struct test_result_t ret; /*!< Test result */
};
For example, a new test case called ``TFM_NS_<TEST_NAME>_TEST_1001`` is created
@@ -262,7 +264,7 @@
/* Append test cases */
static struct test_t <test_name>_tests[] = {
{&tfm_<test_name>_test_1001, "TFM_NS_<TEST_NAME>_TEST_1001",
- "Example test case", {TEST_PASSED}},
+ "Example test case"},
};
/* Register test case into test suites */
@@ -297,22 +299,30 @@
.. Note::
Each test service must have resource requirements declared in a manifest
- file, the contents of test services are the same as secure partitions,but
+ file, the contents of test services are the same as secure partitions, but
their locations are different. Test service manifests shall be set in
- ``tf-m-tests/test/test_services/tfm_test_manifest_list.yaml``.
+ ``tf-m-tests/test/secure_fw/tfm_test_manifest_list.yaml``.
-Configuration
-=============
+Test service implementation
+===========================
-If the new test service names ``tfm_<test_name>_test_service`` only supports for the
-example test, the configuration in
-``tf-m-tests/test/test_services/CMakeLists.txt`` forms like below.
+Test service of individual test
+-------------------------------
-.. code-block:: cmake
+An individual test dedicated test service should be put under the corresponding
+test folder ``test/secure_fw/suites/<test_name>``.
- if (TEST_S_<TEST_NAME> OR TEST_NS_<TEST_NAME>)
- add_subdirectory(tfm_<test_name>_test_service)
- endif()
+``add_subdirectory(suites/<test_name>/<service_dir>)`` shall be added into
+``tf-m-tests/test/secure_fw/secure_tests.cmake`` to make sure that the test
+service is built with secure side configuration.
+
+Common test service
+-------------------
+
+If a new test service is required by multiple test suites, the code should be
+put under ``test/secure_fw/common_test_services``. If the new test suite relies
+on a common test service, please make sure that the build implementation of the
+test service is linked correctly, including the header files and libraries.
**********************************
Out-of-tree regression test suites
@@ -458,4 +468,4 @@
--------------
-*Copyright (c) 2021, Arm Limited. All rights reserved.*
+*Copyright (c) 2021-2022, Arm Limited. All rights reserved.*
diff --git a/docs/technical_references/design_docs/tfm_its_service.rst b/docs/technical_references/design_docs/tfm_its_service.rst
index 922c5c1..7c81565 100644
--- a/docs/technical_references/design_docs/tfm_its_service.rst
+++ b/docs/technical_references/design_docs/tfm_its_service.rst
@@ -84,7 +84,7 @@
tf-m-tests repo:
-``test/suites/its/``
+``test/secure_fw/suites/its/``
- ``non_secure/psa_its_ns_interface_testsuite.c`` - Non-secure interface tests
- ``secure/psa_its_s_interface_testsuite.c`` - Secure interface tests
@@ -277,4 +277,4 @@
--------------
-*Copyright (c) 2019, Arm Limited. All rights reserved.*
+*Copyright (c) 2019-2022, Arm Limited. All rights reserved.*