Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 1 | Build and run tests on OP-TEE reference integration for FVP |
| 2 | =========================================================== |
| 3 | |
| 4 | The Linux based build maintained by the OP-TEE project is used as the reference integration for testing |
| 5 | trusted service deployments on a simulated hardware platform. Service providers deployed within secure partitions |
| 6 | are tested using test executables that run as user-space programs under Linux. Test cases interact with trusted |
| 7 | service providers using standard service access protocols, carried by FF-A based messages. |
| 8 | |
| 9 | The test executables most often used for service level testing on hardware platforms are: |
| 10 | |
| 11 | - *ts-service-test* - contains a set of service-level end-to-end tests. Discovers and communicates |
| 12 | with service providers using libts. |
| 13 | - *psa-api-test* - PSA functional API conformance tests (from external project). Also uses libts. |
| 14 | |
| 15 | This method uses the makefiles from the ``op-tee/build`` repository. |
| 16 | |
| 17 | |
| 18 | Before you start |
| 19 | ---------------- |
| 20 | |
| 21 | Before attempting to run tests on the FVP simulation, the OP-TEE reference integration needs to be |
| 22 | built and run. Read the following guides to understand how to do this: |
| 23 | |
| 24 | - OP-TEE build and run instructions, see: |
| 25 | :ref:`Deploying trusted services in S-EL0 Secure Partitions under OP-TEE` |
| 26 | |
| 27 | - Instructions for loading and running user-space programs on FVP: |
| 28 | :ref:`Running user-space programs on FVP` |
| 29 | |
| 30 | |
Imre Kis | 0343354 | 2024-01-16 17:28:15 +0100 | [diff] [blame] | 31 | Build the Linux application binaries |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 32 | ------------------------------------ |
| 33 | |
| 34 | From the root directory of the workspace, enter the following to build the test applications:: |
| 35 | |
| 36 | make -C build ffa-test-all |
| 37 | |
| 38 | |
| 39 | Run *ts-service-test* |
| 40 | --------------------- |
| 41 | |
| 42 | From the root directory of the workspace, enter:: |
| 43 | |
| 44 | FVP_PATH=../Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3 make -C build run-only |
| 45 | |
| 46 | Once it boots to the login prompt, log in as root and from the FVP terminal, enter:: |
| 47 | |
| 48 | cd /mnt/host |
| 49 | cp -vat /usr out/ts-install/arm-linux/lib out/ts-install/arm-linux/bin |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 50 | out/linux-arm-ffa-user/load_module.sh |
| 51 | ts-service-test -v |
| 52 | |
| 53 | Use the same flow for other user-space programs. Check the output of the ``cp`` command executed to see |
| 54 | executables copied under ``/usr/bin``. |
| 55 | |
Imre Kis | 0343354 | 2024-01-16 17:28:15 +0100 | [diff] [blame] | 56 | .. _build-spmc-tests: |
| 57 | |
| 58 | Build SPMC tests |
| 59 | ---------------- |
| 60 | |
| 61 | Trusted Services includes S-EL0 tests SPs for validating the SPMC's behavior by invoking various FF-A interfaces. These tests |
| 62 | require OP-TEE's `xtest`_ for starting them from the normal world. ``xtest`` uses ``linux-arm-ffa-user`` for accessing the |
| 63 | FF-A layer. Building the SPMC tests uses the same build system but with the ``SPMC_TEST=y`` configuration:: |
| 64 | |
| 65 | make -C build SPMC_TEST=y all |
| 66 | |
| 67 | .. note:: |
| 68 | This build configuration only contains the SPMC test SPs and it does not include any of the :ref:`Services`. |
| 69 | |
Imre Kis | ea35cfe | 2024-01-23 12:55:52 +0100 | [diff] [blame] | 70 | See :ref:`OP-TEE SPMC tests` for further information. |
Imre Kis | 0343354 | 2024-01-16 17:28:15 +0100 | [diff] [blame] | 71 | |
| 72 | Run SPMC tests |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 73 | -------------- |
| 74 | |
Imre Kis | 0343354 | 2024-01-16 17:28:15 +0100 | [diff] [blame] | 75 | From the root directory of the workspace, enter:: |
| 76 | |
| 77 | FVP_PATH=../Base_RevC_AEMvA_pkg/models/Linux64_GCC-9.3 make -C build run-only |
| 78 | |
| 79 | Once it boots to the login prompt, log in as root and from the FVP terminal, enter:: |
| 80 | |
| 81 | cd /mnt/host |
| 82 | out/linux-arm-ffa-user/load_module.sh |
| 83 | xtest -t ffa_spmc |
| 84 | |
| 85 | -------------- |
| 86 | |
| 87 | .. _`xtest`: https://optee.readthedocs.io/en/latest/building/gits/optee_test.html |
| 88 | |
| 89 | *Copyright (c) 2022-2024, Arm Limited and Contributors. All rights reserved.* |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 90 | |
| 91 | SPDX-License-Identifier: BSD-3-Clause |