Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 1 | /* |
Sherry Zhang | 92c499a | 2021-03-08 18:14:15 +0800 | [diff] [blame] | 2 | * Copyright (c) 2017-2021, Arm Limited. All rights reserved. |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include "test_framework_integ_test.h" |
| 9 | #include "test_framework_integ_test_helper.h" |
| 10 | #include "test_framework.h" |
| 11 | |
| 12 | /* Service specific includes */ |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 13 | #if defined(TFM_PARTITION_PROTECTED_STORAGE) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 14 | #include "ps_ns_tests.h" |
| 15 | #endif |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 16 | #if defined(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 17 | #include "its_ns_tests.h" |
| 18 | #endif |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 19 | #if defined(TFM_PARTITION_CRYPTO) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 20 | #include "crypto_ns_tests.h" |
| 21 | #endif |
Sherry Zhang | 92c499a | 2021-03-08 18:14:15 +0800 | [diff] [blame] | 22 | #if defined(TFM_PARTITION_FIRMWARE_UPDATE) |
| 23 | #include "fwu_ns_tests.h" |
| 24 | #endif |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 25 | #if defined(TFM_PARTITION_INITIAL_ATTESTATION) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 26 | #include "attest_ns_tests.h" |
| 27 | #include "qcbor_ns_tests.h" |
| 28 | #ifndef SYMMETRIC_INITIAL_ATTESTATION |
| 29 | #include "t_cose_ns_tests.h" |
| 30 | #endif /* !SYMMETRIC_INITIAL_ATTESTATION */ |
| 31 | #endif |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 32 | #if defined(TFM_PARTITION_PLATFORM) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 33 | #include "platform_ns_tests.h" |
| 34 | #endif |
| 35 | #include "core_ns_tests.h" |
| 36 | #ifdef TFM_PSA_API |
| 37 | #include "ipc_ns_tests.h" |
| 38 | #else |
| 39 | #ifdef TFM_PARTITION_AUDIT_LOG |
| 40 | #include "audit_ns_tests.h" |
| 41 | #endif |
| 42 | #endif /* TFM_PSA_API */ |
| 43 | #ifdef TFM_MULTI_CORE_TOPOLOGY |
| 44 | #include "multi_core_ns_test.h" |
| 45 | #endif /* TFM_MULTI_CORE_TOPOLOGY */ |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 46 | |
| 47 | static struct test_suite_t test_suites[] = { |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 48 | /* List test cases which are compliant with level 1 isolation */ |
| 49 | |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 50 | #if defined(TFM_PARTITION_PROTECTED_STORAGE) || defined(FORWARD_PROT_MSG) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 51 | {®ister_testsuite_ns_psa_ps_interface, 0, 0, 0}, |
| 52 | #endif |
| 53 | |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 54 | #if defined(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) || defined(FORWARD_PROT_MSG) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 55 | /* Non-secure ITS test cases */ |
| 56 | {®ister_testsuite_ns_psa_its_interface, 0, 0, 0}, |
| 57 | #endif |
| 58 | |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 59 | #if defined(TFM_PARTITION_CRYPTO) || defined(FORWARD_PROT_MSG) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 60 | /* Non-secure Crypto test cases */ |
| 61 | {®ister_testsuite_ns_crypto_interface, 0, 0, 0}, |
| 62 | #endif |
| 63 | |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 64 | #if defined(TFM_PARTITION_PLATFORM) || defined(FORWARD_PROT_MSG) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 65 | /* Non-secure platform service test cases */ |
| 66 | {®ister_testsuite_ns_platform_interface, 0, 0, 0}, |
| 67 | #endif |
| 68 | |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 69 | #if defined(TFM_PARTITION_INITIAL_ATTESTATION) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 70 | /* Non-secure initial attestation service test cases */ |
| 71 | {®ister_testsuite_ns_attestation_interface, 0, 0, 0}, |
| 72 | |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 73 | /* Non-secure QCBOR library test cases */ |
| 74 | {®ister_testsuite_ns_qcbor, 0, 0, 0}, |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 75 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 76 | #ifndef SYMMETRIC_INITIAL_ATTESTATION |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 77 | /* Non-secure T_COSE library test cases */ |
| 78 | {®ister_testsuite_ns_t_cose, 0, 0, 0}, |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 79 | #endif /* !SYMMETRIC_INITIAL_ATTESTATION */ |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 80 | #endif |
| 81 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 82 | #ifdef TFM_PARTITION_AUDIT_LOG |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 83 | /* Non-secure Audit Logging test cases */ |
| 84 | {®ister_testsuite_ns_audit_interface, 0, 0, 0}, |
| 85 | #endif |
| 86 | |
Sherry Zhang | 92c499a | 2021-03-08 18:14:15 +0800 | [diff] [blame] | 87 | #ifdef TFM_PARTITION_FIRMWARE_UPDATE |
| 88 | /* Non-secure Firmware Update test cases */ |
| 89 | {®ister_testsuite_ns_psa_fwu_interface, 0, 0, 0}, |
| 90 | #endif |
| 91 | |
Raef Coles | ce57e06 | 2020-10-02 10:39:41 +0100 | [diff] [blame] | 92 | /* Non-secure core test cases */ |
| 93 | {®ister_testsuite_ns_core_positive, 0, 0, 0}, |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 94 | |
| 95 | #ifdef CORE_TEST_INTERACTIVE |
| 96 | /* Non-secure interactive test cases */ |
| 97 | {®ister_testsuite_ns_core_interactive, 0, 0, 0}, |
| 98 | #endif |
| 99 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 100 | #ifdef TFM_PSA_API |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 101 | /* Non-secure IPC test cases */ |
| 102 | {®ister_testsuite_ns_ipc_interface, 0, 0, 0}, |
| 103 | #endif |
| 104 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 105 | #ifdef TFM_MULTI_CORE_TOPOLOGY |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 106 | /* Multi-core topology test cases */ |
| 107 | {®ister_testsuite_multi_core_ns_interface, 0, 0, 0}, |
| 108 | #endif |
| 109 | |
| 110 | /* End of test suites */ |
| 111 | {0, 0, 0, 0} |
| 112 | }; |
| 113 | |
| 114 | enum test_suite_err_t start_integ_test(void) |
| 115 | { |
| 116 | return integ_test("Non-secure", test_suites); |
| 117 | } |
| 118 | |
| 119 | /* Service stand-in for NS tests. To be called from a non-secure context */ |
| 120 | enum test_suite_err_t tfm_non_secure_client_run_tests(void) |
| 121 | { |
| 122 | return start_integ_test(); |
| 123 | } |