Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 1 | Build and run PC based tests |
| 2 | ============================ |
| 3 | |
| 4 | Many components within the Trusted Services project may be built and tested within a native PC environment. |
| 5 | PC based testing is an important part of the development flow and can provide a straight-forward way to check |
| 6 | for regressions and debug problems. PC based tests range from small unit tests up to end-to-end service tests. |
| 7 | All test cases in the Trusted Services project are written for the CppUTest test framework. |
| 8 | |
| 9 | The test executables most often used for PC based testing of Trusted Services components are: |
| 10 | |
| 11 | - *component-test* - a PC executable that runs many component level tests. |
| 12 | - *ts-service-test* - contains a set of service-level end-to-end tests. For PC build, service providers |
| 13 | are included in the libts library. |
| 14 | - *psa-api-test* - PSA functional API conformance tests (from external project). |
| 15 | |
| 16 | |
| 17 | Before you start |
| 18 | ---------------- |
| 19 | Before attempting to run any builds, ensure that all necessary tools are installed. See: :ref:`Software Requirements` |
| 20 | |
| 21 | |
| 22 | Build and run *component-test* |
| 23 | ------------------------------ |
| 24 | |
| 25 | From the root directory of the checked-out TS project, enter the following:: |
| 26 | |
| 27 | cmake -B build-ct -S deployments/component-test/linux-pc |
| 28 | make -C build-ct install |
| 29 | build-ct/install/linux-pc/bin/component-test -v |
| 30 | |
| 31 | |
| 32 | Build and run *ts-service-test* |
| 33 | ------------------------------- |
| 34 | |
| 35 | From the root directory of the checked-out TS project, enter the following:: |
| 36 | |
| 37 | cmake -B build-ts -S deployments/ts-service-test/linux-pc |
| 38 | make -C build-ts install |
| 39 | LD_PRELOAD=build-ts/install/linux-pc/lib/libts.so build-ts/install/linux-pc/bin/ts-service-test -v |
| 40 | |
| 41 | Build and run *psa-api-test* |
| 42 | ---------------------------- |
| 43 | Tests for each API are built as separate executables. Test are available for the following APIs:: |
| 44 | |
| 45 | crypto |
| 46 | initial_attestation |
| 47 | internal_trusted_storage |
| 48 | protected_storage |
| 49 | |
| 50 | To build and run tests for the Crypto API, enter the following (use the same flow for other APIs):: |
| 51 | |
| 52 | cmake -B build-pa deployments/psa-api-test/crypto/linux-pc |
| 53 | make -C build-pa install |
| 54 | LD_PRELOAD=build-pa/install/linux-pc/lib/libts.so build-pa/install/linux-pc/bin/psa-crypto-api-test |
| 55 | |
Gabor Toth | e53a2a2 | 2023-04-12 09:51:35 +0200 | [diff] [blame] | 56 | psa-api test binaries accept the listed command-line arguments: |
| 57 | |
| 58 | =========== ==================================================================== |
| 59 | CL argument Description |
| 60 | =========== ==================================================================== |
| 61 | -v verbose mode |
| 62 | -h print supported arguments |
| 63 | -l print a list of all the available tests |
| 64 | -t run only the listed tests with 'test\_' prefix and semicolon postfix |
| 65 | e.g: "-t test_201;test_205;test_260;" |
| 66 | =========== ==================================================================== |
| 67 | |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 68 | More information |
| 69 | ---------------- |
| 70 | For more information about deployments and building, see: :ref:`Build Instructions` |
| 71 | |
| 72 | PSA functional API conformance tests git location: https://github.com/ARM-software/psa-arch-tests.git |
| 73 | |
| 74 | -------------- |
| 75 | |
Gabor Toth | e53a2a2 | 2023-04-12 09:51:35 +0200 | [diff] [blame] | 76 | *Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.* |
Julian Hall | c6268b0 | 2022-03-10 10:31:09 +0000 | [diff] [blame] | 77 | |
| 78 | SPDX-License-Identifier: BSD-3-Clause |