blob: 0b3f8c19b33e0c7aa45ce5272a8306498d63c056 [file] [log] [blame]
Kevin Peng62a87112020-07-07 15:07:46 +08001/*
Summer Qinf54e7292022-10-13 15:29:28 +08002 * Copyright (c) 2017-2022, 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
Kevin Penge85c6a82022-03-03 17:12:27 +080031#ifdef TEST_S_IPC
32#include "ipc_s_tests.h"
33#endif
34#ifdef TEST_S_SFN_BACKEND
35#include "sfn_s_tests.h"
36#endif
Feder Liangdb53c6b2021-09-07 15:42:09 +080037#if defined (TEST_S_FPU)
38#include "fpu_s_tests.h"
39#endif
Jianliang Shen2959c1f2021-09-01 10:14:06 +080040#ifdef EXTRA_S_TEST_SUITE
41#include "extra_s_tests.h"
42#endif
Kevin Peng62a87112020-07-07 15:07:46 +080043
44static struct test_suite_t test_suites[] = {
Kevin Peng018f7182022-03-07 14:11:20 +080045#ifdef TEST_S_IPC
46 /* Secure IPC test cases */
47 {&register_testsuite_s_ipc_interface, 0, 0, 0},
48#endif
49
50#ifdef TEST_S_SFN_BACKEND
51 /* Secure SFN backend test cases */
52 {&register_testsuite_s_sfn_interface, 0, 0, 0},
53#endif
54
shejia01e0dd80a2021-07-12 17:47:50 +080055#ifdef TEST_S_PS
Kevin Peng62a87112020-07-07 15:07:46 +080056 {&register_testsuite_s_psa_ps_interface, 0, 0, 0},
57 {&register_testsuite_s_psa_ps_reliability, 0, 0, 0},
58
59#ifdef PS_TEST_NV_COUNTERS
60 {&register_testsuite_s_rollback_protection, 0, 0, 0},
61#endif
62#endif
63
shejia01e0dd80a2021-07-12 17:47:50 +080064#ifdef TEST_S_ITS
Kevin Peng62a87112020-07-07 15:07:46 +080065 /* Secure ITS test cases */
66 {&register_testsuite_s_psa_its_interface, 0, 0, 0},
67 {&register_testsuite_s_psa_its_reliability, 0, 0, 0},
68#endif
69
shejia01e0dd80a2021-07-12 17:47:50 +080070#ifdef TEST_S_CRYPTO
Kevin Peng62a87112020-07-07 15:07:46 +080071 /* Crypto test cases */
72 {&register_testsuite_s_crypto_interface, 0, 0, 0},
73#endif
74
shejia01e0dd80a2021-07-12 17:47:50 +080075#ifdef TEST_S_ATTESTATION
Kevin Peng62a87112020-07-07 15:07:46 +080076 /* Secure initial attestation service test cases */
77 {&register_testsuite_s_attestation_interface, 0, 0, 0},
78#endif
79
shejia01e0dd80a2021-07-12 17:47:50 +080080#ifdef TEST_S_PLATFORM
Kevin Peng62a87112020-07-07 15:07:46 +080081 /* Secure platform service test cases */
82 {&register_testsuite_s_platform_interface, 0, 0, 0},
83#endif
84
shejia01e0dd80a2021-07-12 17:47:50 +080085#ifdef TEST_S_FWU
Sherry Zhanga59fecd2021-05-24 16:37:36 +080086 /* Secure Firmware Update test cases */
Sherry Zhang92c499a2021-03-08 18:14:15 +080087 {&register_testsuite_s_psa_fwu_interface, 0, 0, 0},
88#endif
89
Feder Liangdb53c6b2021-09-07 15:42:09 +080090#ifdef TEST_S_FPU
91 /* Secure FPU test cases */
92 {&register_testsuite_s_fpu_interface, 0, 0, 0},
93#endif
94
Jianliang Shen2959c1f2021-09-01 10:14:06 +080095#ifdef EXTRA_S_TEST_SUITE
96 /* Secure extra test cases */
97 {&register_testsuite_extra_s_interface, 0, 0, 0},
98#endif
99
Kevin Peng62a87112020-07-07 15:07:46 +0800100 /* End of test suites */
101 {0, 0, 0, 0}
102};
103
104static void setup_integ_test(void)
105{
106 /* Left empty intentionally, currently implemented
107 * test suites require no setup
108 */
109}
110
111static void tear_down_integ_test(void)
112{
113 /* Left empty intentionally, currently implemented
114 * test suites require no tear down
115 */
116}
117
118enum test_suite_err_t start_integ_test(void)
119{
120 enum test_suite_err_t retval;
121
122 setup_integ_test();
123 retval = integ_test("Secure", test_suites);
124 tear_down_integ_test();
125 return retval;
126}