Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 1 | /* |
Feder Liang | 7abe9a4 | 2021-12-03 17:54:58 +0800 | [diff] [blame^] | 2 | * Copyright (c) 2017-2022, 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 */ |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 13 | #ifdef TEST_NS_PS |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 14 | #include "ps_ns_tests.h" |
| 15 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 16 | #ifdef TEST_NS_ITS |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 17 | #include "its_ns_tests.h" |
| 18 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 19 | #ifdef TEST_NS_CRYPTO |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 20 | #include "crypto_ns_tests.h" |
| 21 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 22 | #ifdef TEST_NS_FWU |
Sherry Zhang | 92c499a | 2021-03-08 18:14:15 +0800 | [diff] [blame] | 23 | #include "fwu_ns_tests.h" |
| 24 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 25 | #ifdef TEST_NS_ATTESTATION |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 26 | #include "attest_ns_tests.h" |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 27 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 28 | #ifdef TEST_NS_QCBOR |
| 29 | #include "qcbor_ns_tests.h" |
| 30 | #endif |
| 31 | #ifdef TEST_NS_T_COSE |
| 32 | #include "t_cose_ns_tests.h" |
| 33 | #endif |
| 34 | #ifdef TEST_NS_PLATFORM |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 35 | #include "platform_ns_tests.h" |
| 36 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 37 | #ifdef TEST_NS_CORE |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 38 | #include "core_ns_tests.h" |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 39 | #endif |
| 40 | #ifdef TEST_NS_IPC |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 41 | #include "ipc_ns_tests.h" |
| 42 | #else |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 43 | #ifdef TEST_NS_AUDIT |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 44 | #include "audit_ns_tests.h" |
| 45 | #endif |
| 46 | #endif /* TFM_PSA_API */ |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 47 | #ifdef TEST_NS_MULTI_CORE |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 48 | #include "multi_core_ns_test.h" |
| 49 | #endif /* TFM_MULTI_CORE_TOPOLOGY */ |
Mate Toth-Pal | b3f96d2 | 2021-05-12 08:42:34 +0200 | [diff] [blame] | 50 | #ifdef TFM_FUZZER_TOOL_TESTS |
| 51 | #include "tf_fuzz_testsuite.h" |
| 52 | #endif /* TFM_FUZZER_TOOL_TESTS */ |
Xinyu Zhang | 92fe758 | 2021-09-24 17:11:49 +0800 | [diff] [blame] | 53 | #ifdef TEST_NS_MANAGE_NSID |
| 54 | #include "nsid_testsuite.h" |
| 55 | #endif /* TEST_NS_MANAGE_NSID */ |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 56 | #if defined(TEST_NS_SLIH_IRQ) || defined(TEST_NS_FLIH_IRQ) |
Kevin Peng | a860433 | 2021-04-23 17:33:30 +0800 | [diff] [blame] | 57 | #include "irq_testsuite.h" |
| 58 | #endif |
Mingyang Sun | 5df4624 | 2021-11-03 18:31:04 +0800 | [diff] [blame] | 59 | #ifdef TEST_NS_SFN_BACKEND |
| 60 | #include "sfn_ns_tests.h" |
| 61 | #endif |
Feder Liang | 7abe9a4 | 2021-12-03 17:54:58 +0800 | [diff] [blame^] | 62 | #ifdef TEST_NS_FPU |
| 63 | #include "fpu_ns_tests.h" |
| 64 | #endif |
Jianliang Shen | 2959c1f | 2021-09-01 10:14:06 +0800 | [diff] [blame] | 65 | #ifdef EXTRA_NS_TEST_SUITE |
| 66 | #include "extra_ns_tests.h" |
| 67 | #endif |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 68 | |
| 69 | static struct test_suite_t test_suites[] = { |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 70 | /* List test cases which are compliant with level 1 isolation */ |
| 71 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 72 | #ifdef TEST_NS_PS |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 73 | {®ister_testsuite_ns_psa_ps_interface, 0, 0, 0}, |
| 74 | #endif |
| 75 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 76 | #ifdef TEST_NS_ITS |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 77 | /* Non-secure ITS test cases */ |
| 78 | {®ister_testsuite_ns_psa_its_interface, 0, 0, 0}, |
| 79 | #endif |
| 80 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 81 | #ifdef TEST_NS_CRYPTO |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 82 | /* Non-secure Crypto test cases */ |
| 83 | {®ister_testsuite_ns_crypto_interface, 0, 0, 0}, |
| 84 | #endif |
| 85 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 86 | #ifdef TEST_NS_PLATFORM |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 87 | /* Non-secure platform service test cases */ |
| 88 | {®ister_testsuite_ns_platform_interface, 0, 0, 0}, |
| 89 | #endif |
| 90 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 91 | #ifdef TEST_NS_ATTESTATION |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 92 | /* Non-secure initial attestation service test cases */ |
| 93 | {®ister_testsuite_ns_attestation_interface, 0, 0, 0}, |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 94 | #endif |
| 95 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 96 | #ifdef TEST_NS_QCBOR |
| 97 | /* Non-secure QCBOR library test cases */ |
| 98 | {®ister_testsuite_ns_qcbor, 0, 0, 0}, |
| 99 | #endif |
| 100 | |
| 101 | #ifdef TEST_NS_T_COSE |
| 102 | /* Non-secure T_COSE library test cases */ |
| 103 | {®ister_testsuite_ns_t_cose, 0, 0, 0}, |
| 104 | #endif |
| 105 | |
| 106 | #ifdef TEST_NS_AUDIT |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 107 | /* Non-secure Audit Logging test cases */ |
| 108 | {®ister_testsuite_ns_audit_interface, 0, 0, 0}, |
| 109 | #endif |
| 110 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 111 | #ifdef TEST_NS_FWU |
Sherry Zhang | 92c499a | 2021-03-08 18:14:15 +0800 | [diff] [blame] | 112 | /* Non-secure Firmware Update test cases */ |
| 113 | {®ister_testsuite_ns_psa_fwu_interface, 0, 0, 0}, |
| 114 | #endif |
| 115 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 116 | #ifdef TEST_NS_CORE |
| 117 | /* Non-secure core test cases */ |
| 118 | {®ister_testsuite_ns_core_positive, 0, 0, 0}, |
| 119 | #endif |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 120 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 121 | #ifdef TEST_NS_IPC |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 122 | /* Non-secure IPC test cases */ |
| 123 | {®ister_testsuite_ns_ipc_interface, 0, 0, 0}, |
| 124 | #endif |
| 125 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 126 | #ifdef TEST_NS_MULTI_CORE |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 127 | /* Multi-core topology test cases */ |
| 128 | {®ister_testsuite_multi_core_ns_interface, 0, 0, 0}, |
| 129 | #endif |
| 130 | |
Jianliang Shen | 2959c1f | 2021-09-01 10:14:06 +0800 | [diff] [blame] | 131 | #ifdef EXTRA_NS_TEST_SUITE |
| 132 | /* Non-secure extra test cases */ |
| 133 | {®ister_testsuite_extra_ns_interface, 0, 0, 0}, |
| 134 | #endif |
| 135 | |
Mate Toth-Pal | b3f96d2 | 2021-05-12 08:42:34 +0200 | [diff] [blame] | 136 | #ifdef TFM_FUZZER_TOOL_TESTS |
| 137 | {®ister_testsuite_tf_fuzz_test, 0, 0, 0}, |
| 138 | #endif /* TFM_FUZZER_TOOL_TESTS */ |
| 139 | |
Xinyu Zhang | 92fe758 | 2021-09-24 17:11:49 +0800 | [diff] [blame] | 140 | #ifdef TEST_NS_MANAGE_NSID |
| 141 | {®ister_testsuite_nsid_test, 0, 0, 0}, |
| 142 | #endif /* TEST_NS_MANAGE_NSID */ |
| 143 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 144 | #if defined(TEST_NS_SLIH_IRQ) || defined(TEST_NS_FLIH_IRQ) |
Kevin Peng | a860433 | 2021-04-23 17:33:30 +0800 | [diff] [blame] | 145 | {®ister_testsuite_irq_test, 0, 0, 0}, |
| 146 | #endif |
| 147 | |
Mingyang Sun | 5df4624 | 2021-11-03 18:31:04 +0800 | [diff] [blame] | 148 | #ifdef TEST_NS_SFN_BACKEND |
| 149 | {®ister_testsuite_ns_sfn_interface, 0, 0, 0}, |
| 150 | #endif |
| 151 | |
Feder Liang | 7abe9a4 | 2021-12-03 17:54:58 +0800 | [diff] [blame^] | 152 | #ifdef TEST_NS_FPU |
| 153 | {®ister_testsuite_ns_fpu_interface, 0, 0, 0}, |
| 154 | #endif |
| 155 | |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 156 | /* End of test suites */ |
| 157 | {0, 0, 0, 0} |
| 158 | }; |
| 159 | |
| 160 | enum test_suite_err_t start_integ_test(void) |
| 161 | { |
| 162 | return integ_test("Non-secure", test_suites); |
| 163 | } |
| 164 | |
| 165 | /* Service stand-in for NS tests. To be called from a non-secure context */ |
| 166 | enum test_suite_err_t tfm_non_secure_client_run_tests(void) |
| 167 | { |
| 168 | return start_integ_test(); |
| 169 | } |