blob: 674144ee74c7a4c1f6b3c06ca57dc86bdd241b70 [file] [log] [blame]
Kevin Peng62a87112020-07-07 15:07:46 +08001/*
Sherry Zhang92c499a2021-03-08 18:14:15 +08002 * Copyright (c) 2017-2021, Arm Limited. All rights reserved.
Kevin Peng62a87112020-07-07 15:07:46 +08003 *
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 */
shejia01e0dd80a2021-07-12 17:47:50 +080013#ifdef TEST_S_PS
Raef Coles652bb8a2020-09-24 11:27:38 +010014#include "ps_tests.h"
15#endif
shejia01e0dd80a2021-07-12 17:47:50 +080016#ifdef TEST_S_ITS
Raef Coles652bb8a2020-09-24 11:27:38 +010017#include "its_s_tests.h"
18#endif
shejia01e0dd80a2021-07-12 17:47:50 +080019#ifdef TEST_S_ATTESTATION
Raef Coles652bb8a2020-09-24 11:27:38 +010020#include "attest_s_tests.h"
21#endif
shejia01e0dd80a2021-07-12 17:47:50 +080022#ifdef TEST_S_CRYPTO
Raef Coles652bb8a2020-09-24 11:27:38 +010023#include "crypto_s_tests.h"
24#endif
shejia01e0dd80a2021-07-12 17:47:50 +080025#ifdef TEST_S_FWU
Sherry Zhang92c499a2021-03-08 18:14:15 +080026#include "fwu_s_tests.h"
27#endif
shejia01e0dd80a2021-07-12 17:47:50 +080028#ifdef TEST_S_PLATFORM
Raef Coles652bb8a2020-09-24 11:27:38 +010029#include "platform_s_tests.h"
30#endif
shejia01e0dd80a2021-07-12 17:47:50 +080031#ifdef TEST_S_IPC
Raef Coles652bb8a2020-09-24 11:27:38 +010032#include "ipc_s_tests.h"
33#else
shejia01e0dd80a2021-07-12 17:47:50 +080034#ifdef TEST_S_AUDIT
Raef Coles652bb8a2020-09-24 11:27:38 +010035#include "audit_s_tests.h"
36#endif
37#endif /* TFM_PSA_API */
Feder Liangdb53c6b2021-09-07 15:42:09 +080038#if defined (TEST_S_FPU)
39#include "fpu_s_tests.h"
40#endif
Jianliang Shen2959c1f2021-09-01 10:14:06 +080041#ifdef EXTRA_S_TEST_SUITE
42#include "extra_s_tests.h"
43#endif
Kevin Peng62a87112020-07-07 15:07:46 +080044
45static struct test_suite_t test_suites[] = {
shejia01e0dd80a2021-07-12 17:47:50 +080046#ifdef TEST_S_PS
Kevin Peng62a87112020-07-07 15:07:46 +080047 {&register_testsuite_s_psa_ps_interface, 0, 0, 0},
48 {&register_testsuite_s_psa_ps_reliability, 0, 0, 0},
49
50#ifdef PS_TEST_NV_COUNTERS
51 {&register_testsuite_s_rollback_protection, 0, 0, 0},
52#endif
53#endif
54
shejia01e0dd80a2021-07-12 17:47:50 +080055#ifdef TEST_S_ITS
Kevin Peng62a87112020-07-07 15:07:46 +080056 /* Secure ITS test cases */
57 {&register_testsuite_s_psa_its_interface, 0, 0, 0},
58 {&register_testsuite_s_psa_its_reliability, 0, 0, 0},
59#endif
60
shejia01e0dd80a2021-07-12 17:47:50 +080061#ifdef TEST_S_CRYPTO
Kevin Peng62a87112020-07-07 15:07:46 +080062 /* Crypto test cases */
63 {&register_testsuite_s_crypto_interface, 0, 0, 0},
64#endif
65
shejia01e0dd80a2021-07-12 17:47:50 +080066#ifdef TEST_S_ATTESTATION
Kevin Peng62a87112020-07-07 15:07:46 +080067 /* Secure initial attestation service test cases */
68 {&register_testsuite_s_attestation_interface, 0, 0, 0},
69#endif
70
shejia01e0dd80a2021-07-12 17:47:50 +080071#ifdef TEST_S_PLATFORM
Kevin Peng62a87112020-07-07 15:07:46 +080072 /* Secure platform service test cases */
73 {&register_testsuite_s_platform_interface, 0, 0, 0},
74#endif
75
shejia01e0dd80a2021-07-12 17:47:50 +080076#ifdef TEST_S_AUDIT
Kevin Peng62a87112020-07-07 15:07:46 +080077 /* Secure Audit Logging test cases */
78 {&register_testsuite_s_audit_interface, 0, 0, 0},
79#endif
80
shejia01e0dd80a2021-07-12 17:47:50 +080081#ifdef TEST_S_FWU
Sherry Zhanga59fecd2021-05-24 16:37:36 +080082 /* Secure Firmware Update test cases */
Sherry Zhang92c499a2021-03-08 18:14:15 +080083 {&register_testsuite_s_psa_fwu_interface, 0, 0, 0},
84#endif
85
shejia01e0dd80a2021-07-12 17:47:50 +080086#ifdef TEST_S_IPC
Kevin Peng62a87112020-07-07 15:07:46 +080087 /* Secure IPC test cases */
88 {&register_testsuite_s_ipc_interface, 0, 0, 0},
89#endif
Jianliang Shen2959c1f2021-09-01 10:14:06 +080090
Feder Liangdb53c6b2021-09-07 15:42:09 +080091#ifdef TEST_S_FPU
92 /* Secure FPU test cases */
93 {&register_testsuite_s_fpu_interface, 0, 0, 0},
94#endif
95
Jianliang Shen2959c1f2021-09-01 10:14:06 +080096#ifdef EXTRA_S_TEST_SUITE
97 /* Secure extra test cases */
98 {&register_testsuite_extra_s_interface, 0, 0, 0},
99#endif
100
Kevin Peng62a87112020-07-07 15:07:46 +0800101 /* End of test suites */
102 {0, 0, 0, 0}
103};
104
105static void setup_integ_test(void)
106{
107 /* Left empty intentionally, currently implemented
108 * test suites require no setup
109 */
110}
111
112static void tear_down_integ_test(void)
113{
114 /* Left empty intentionally, currently implemented
115 * test suites require no tear down
116 */
117}
118
119enum test_suite_err_t start_integ_test(void)
120{
121 enum test_suite_err_t retval;
122
123 setup_integ_test();
124 retval = integ_test("Secure", test_suites);
125 tear_down_integ_test();
126 return retval;
127}