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