blob: 75c19d57e2e6bb25be5936dd9c07ef29a6e68c28 [file] [log] [blame]
Kevin Peng62a87112020-07-07 15:07:46 +08001/*
Feder Liang7abe9a42021-12-03 17:54:58 +08002 * Copyright (c) 2017-2022, Arm Limited. All rights reserved.
Chris Brand23275982022-05-20 14:54:59 -07003 * Copyright (c) 2022, Cypress Semiconductor Corporation (an Infineon company)
4 * or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
Kevin Peng62a87112020-07-07 15:07:46 +08005 *
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 */
shejia01e0dd80a2021-07-12 17:47:50 +080015#ifdef TEST_NS_PS
Raef Coles652bb8a2020-09-24 11:27:38 +010016#include "ps_ns_tests.h"
17#endif
shejia01e0dd80a2021-07-12 17:47:50 +080018#ifdef TEST_NS_ITS
Raef Coles652bb8a2020-09-24 11:27:38 +010019#include "its_ns_tests.h"
20#endif
shejia01e0dd80a2021-07-12 17:47:50 +080021#ifdef TEST_NS_CRYPTO
Raef Coles652bb8a2020-09-24 11:27:38 +010022#include "crypto_ns_tests.h"
23#endif
shejia01e0dd80a2021-07-12 17:47:50 +080024#ifdef TEST_NS_FWU
Sherry Zhang92c499a2021-03-08 18:14:15 +080025#include "fwu_ns_tests.h"
26#endif
shejia01e0dd80a2021-07-12 17:47:50 +080027#ifdef TEST_NS_ATTESTATION
Raef Coles652bb8a2020-09-24 11:27:38 +010028#include "attest_ns_tests.h"
Raef Coles652bb8a2020-09-24 11:27:38 +010029#endif
shejia01e0dd80a2021-07-12 17:47:50 +080030#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 Coles652bb8a2020-09-24 11:27:38 +010037#include "platform_ns_tests.h"
38#endif
shejia01e0dd80a2021-07-12 17:47:50 +080039#ifdef TEST_NS_CORE
Raef Coles652bb8a2020-09-24 11:27:38 +010040#include "core_ns_tests.h"
shejia01e0dd80a2021-07-12 17:47:50 +080041#endif
42#ifdef TEST_NS_IPC
Raef Coles652bb8a2020-09-24 11:27:38 +010043#include "ipc_ns_tests.h"
44#else
shejia01e0dd80a2021-07-12 17:47:50 +080045#ifdef TEST_NS_AUDIT
Raef Coles652bb8a2020-09-24 11:27:38 +010046#include "audit_ns_tests.h"
47#endif
48#endif /* TFM_PSA_API */
shejia01e0dd80a2021-07-12 17:47:50 +080049#ifdef TEST_NS_MULTI_CORE
Raef Coles652bb8a2020-09-24 11:27:38 +010050#include "multi_core_ns_test.h"
Chris Brand23275982022-05-20 14:54:59 -070051#endif /* TEST_NS_MULTI_CORE */
Mate Toth-Palb3f96d22021-05-12 08:42:34 +020052#ifdef TFM_FUZZER_TOOL_TESTS
53#include "tf_fuzz_testsuite.h"
54#endif /* TFM_FUZZER_TOOL_TESTS */
Xinyu Zhang92fe7582021-09-24 17:11:49 +080055#ifdef TEST_NS_MANAGE_NSID
56#include "nsid_testsuite.h"
57#endif /* TEST_NS_MANAGE_NSID */
shejia01e0dd80a2021-07-12 17:47:50 +080058#if defined(TEST_NS_SLIH_IRQ) || defined(TEST_NS_FLIH_IRQ)
Kevin Penga8604332021-04-23 17:33:30 +080059#include "irq_testsuite.h"
60#endif
Mingyang Sun5df46242021-11-03 18:31:04 +080061#ifdef TEST_NS_SFN_BACKEND
62#include "sfn_ns_tests.h"
63#endif
Feder Liang7abe9a42021-12-03 17:54:58 +080064#ifdef TEST_NS_FPU
65#include "fpu_ns_tests.h"
66#endif
Jianliang Shen2959c1f2021-09-01 10:14:06 +080067#ifdef EXTRA_NS_TEST_SUITE
68#include "extra_ns_tests.h"
69#endif
Kevin Peng62a87112020-07-07 15:07:46 +080070
71static struct test_suite_t test_suites[] = {
Kevin Peng62a87112020-07-07 15:07:46 +080072 /* List test cases which are compliant with level 1 isolation */
Kevin Peng018f7182022-03-07 14:11:20 +080073#ifdef TEST_NS_CORE
74 /* Non-secure core test cases */
75 {&register_testsuite_ns_core_positive, 0, 0, 0},
76#endif
77
78#ifdef TEST_NS_IPC
79 /* Non-secure IPC test cases */
80 {&register_testsuite_ns_ipc_interface, 0, 0, 0},
81#endif
82
83#ifdef TEST_NS_SFN_BACKEND
84 {&register_testsuite_ns_sfn_interface, 0, 0, 0},
85#endif
Kevin Peng62a87112020-07-07 15:07:46 +080086
shejia01e0dd80a2021-07-12 17:47:50 +080087#ifdef TEST_NS_PS
Kevin Peng62a87112020-07-07 15:07:46 +080088 {&register_testsuite_ns_psa_ps_interface, 0, 0, 0},
89#endif
90
shejia01e0dd80a2021-07-12 17:47:50 +080091#ifdef TEST_NS_ITS
Kevin Peng62a87112020-07-07 15:07:46 +080092 /* Non-secure ITS test cases */
93 {&register_testsuite_ns_psa_its_interface, 0, 0, 0},
94#endif
95
shejia01e0dd80a2021-07-12 17:47:50 +080096#ifdef TEST_NS_CRYPTO
Kevin Peng62a87112020-07-07 15:07:46 +080097 /* Non-secure Crypto test cases */
98 {&register_testsuite_ns_crypto_interface, 0, 0, 0},
99#endif
100
shejia01e0dd80a2021-07-12 17:47:50 +0800101#ifdef TEST_NS_PLATFORM
Kevin Peng62a87112020-07-07 15:07:46 +0800102 /* Non-secure platform service test cases */
103 {&register_testsuite_ns_platform_interface, 0, 0, 0},
104#endif
105
shejia01e0dd80a2021-07-12 17:47:50 +0800106#ifdef TEST_NS_ATTESTATION
Raef Coles652bb8a2020-09-24 11:27:38 +0100107 /* Non-secure initial attestation service test cases */
108 {&register_testsuite_ns_attestation_interface, 0, 0, 0},
Kevin Peng62a87112020-07-07 15:07:46 +0800109#endif
110
shejia01e0dd80a2021-07-12 17:47:50 +0800111#ifdef TEST_NS_QCBOR
112 /* Non-secure QCBOR library test cases */
113 {&register_testsuite_ns_qcbor, 0, 0, 0},
114#endif
115
116#ifdef TEST_NS_T_COSE
117 /* Non-secure T_COSE library test cases */
118 {&register_testsuite_ns_t_cose, 0, 0, 0},
119#endif
120
121#ifdef TEST_NS_AUDIT
Kevin Peng62a87112020-07-07 15:07:46 +0800122 /* Non-secure Audit Logging test cases */
123 {&register_testsuite_ns_audit_interface, 0, 0, 0},
124#endif
125
shejia01e0dd80a2021-07-12 17:47:50 +0800126#ifdef TEST_NS_FWU
Sherry Zhang92c499a2021-03-08 18:14:15 +0800127 /* Non-secure Firmware Update test cases */
128 {&register_testsuite_ns_psa_fwu_interface, 0, 0, 0},
129#endif
130
shejia01e0dd80a2021-07-12 17:47:50 +0800131#ifdef TEST_NS_MULTI_CORE
Kevin Peng62a87112020-07-07 15:07:46 +0800132 /* Multi-core topology test cases */
133 {&register_testsuite_multi_core_ns_interface, 0, 0, 0},
134#endif
135
Jianliang Shen2959c1f2021-09-01 10:14:06 +0800136#ifdef EXTRA_NS_TEST_SUITE
137 /* Non-secure extra test cases */
138 {&register_testsuite_extra_ns_interface, 0, 0, 0},
139#endif
140
Mate Toth-Palb3f96d22021-05-12 08:42:34 +0200141#ifdef TFM_FUZZER_TOOL_TESTS
142 {&register_testsuite_tf_fuzz_test, 0, 0, 0},
143#endif /* TFM_FUZZER_TOOL_TESTS */
144
Xinyu Zhang92fe7582021-09-24 17:11:49 +0800145#ifdef TEST_NS_MANAGE_NSID
146 {&register_testsuite_nsid_test, 0, 0, 0},
147#endif /* TEST_NS_MANAGE_NSID */
148
shejia01e0dd80a2021-07-12 17:47:50 +0800149#if defined(TEST_NS_SLIH_IRQ) || defined(TEST_NS_FLIH_IRQ)
Kevin Penga8604332021-04-23 17:33:30 +0800150 {&register_testsuite_irq_test, 0, 0, 0},
151#endif
152
Feder Liang7abe9a42021-12-03 17:54:58 +0800153#ifdef TEST_NS_FPU
154 {&register_testsuite_ns_fpu_interface, 0, 0, 0},
155#endif
156
Kevin Peng62a87112020-07-07 15:07:46 +0800157 /* End of test suites */
158 {0, 0, 0, 0}
159};
160
161enum test_suite_err_t start_integ_test(void)
162{
163 return integ_test("Non-secure", test_suites);
164}
165
166/* Service stand-in for NS tests. To be called from a non-secure context */
167enum test_suite_err_t tfm_non_secure_client_run_tests(void)
168{
169 return start_integ_test();
170}