blob: 5355990e54f7422dc5e560fe7487af9231315772 [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_AUDIT
Raef Coles652bb8a2020-09-24 11:27:38 +010032#include "audit_s_tests.h"
33#endif
Kevin Penge85c6a82022-03-03 17:12:27 +080034#ifdef TEST_S_IPC
35#include "ipc_s_tests.h"
36#endif
37#ifdef TEST_S_SFN_BACKEND
38#include "sfn_s_tests.h"
39#endif
Feder Liangdb53c6b2021-09-07 15:42:09 +080040#if defined (TEST_S_FPU)
41#include "fpu_s_tests.h"
42#endif
Jianliang Shen2959c1f2021-09-01 10:14:06 +080043#ifdef EXTRA_S_TEST_SUITE
44#include "extra_s_tests.h"
45#endif
Kevin Peng62a87112020-07-07 15:07:46 +080046
47static struct test_suite_t test_suites[] = {
Kevin Peng018f7182022-03-07 14:11:20 +080048#ifdef TEST_S_IPC
49 /* Secure IPC test cases */
50 {&register_testsuite_s_ipc_interface, 0, 0, 0},
51#endif
52
53#ifdef TEST_S_SFN_BACKEND
54 /* Secure SFN backend test cases */
55 {&register_testsuite_s_sfn_interface, 0, 0, 0},
56#endif
57
shejia01e0dd80a2021-07-12 17:47:50 +080058#ifdef TEST_S_PS
Kevin Peng62a87112020-07-07 15:07:46 +080059 {&register_testsuite_s_psa_ps_interface, 0, 0, 0},
60 {&register_testsuite_s_psa_ps_reliability, 0, 0, 0},
61
62#ifdef PS_TEST_NV_COUNTERS
63 {&register_testsuite_s_rollback_protection, 0, 0, 0},
64#endif
65#endif
66
shejia01e0dd80a2021-07-12 17:47:50 +080067#ifdef TEST_S_ITS
Kevin Peng62a87112020-07-07 15:07:46 +080068 /* Secure ITS test cases */
69 {&register_testsuite_s_psa_its_interface, 0, 0, 0},
70 {&register_testsuite_s_psa_its_reliability, 0, 0, 0},
71#endif
72
shejia01e0dd80a2021-07-12 17:47:50 +080073#ifdef TEST_S_CRYPTO
Kevin Peng62a87112020-07-07 15:07:46 +080074 /* Crypto test cases */
75 {&register_testsuite_s_crypto_interface, 0, 0, 0},
76#endif
77
shejia01e0dd80a2021-07-12 17:47:50 +080078#ifdef TEST_S_ATTESTATION
Kevin Peng62a87112020-07-07 15:07:46 +080079 /* Secure initial attestation service test cases */
80 {&register_testsuite_s_attestation_interface, 0, 0, 0},
81#endif
82
shejia01e0dd80a2021-07-12 17:47:50 +080083#ifdef TEST_S_PLATFORM
Kevin Peng62a87112020-07-07 15:07:46 +080084 /* Secure platform service test cases */
85 {&register_testsuite_s_platform_interface, 0, 0, 0},
86#endif
87
shejia01e0dd80a2021-07-12 17:47:50 +080088#ifdef TEST_S_AUDIT
Kevin Peng62a87112020-07-07 15:07:46 +080089 /* Secure Audit Logging test cases */
90 {&register_testsuite_s_audit_interface, 0, 0, 0},
91#endif
92
shejia01e0dd80a2021-07-12 17:47:50 +080093#ifdef TEST_S_FWU
Sherry Zhanga59fecd2021-05-24 16:37:36 +080094 /* Secure Firmware Update test cases */
Sherry Zhang92c499a2021-03-08 18:14:15 +080095 {&register_testsuite_s_psa_fwu_interface, 0, 0, 0},
96#endif
97
Feder Liangdb53c6b2021-09-07 15:42:09 +080098#ifdef TEST_S_FPU
99 /* Secure FPU test cases */
100 {&register_testsuite_s_fpu_interface, 0, 0, 0},
101#endif
102
Jianliang Shen2959c1f2021-09-01 10:14:06 +0800103#ifdef EXTRA_S_TEST_SUITE
104 /* Secure extra test cases */
105 {&register_testsuite_extra_s_interface, 0, 0, 0},
106#endif
107
Kevin Peng62a87112020-07-07 15:07:46 +0800108 /* End of test suites */
109 {0, 0, 0, 0}
110};
111
112static void setup_integ_test(void)
113{
114 /* Left empty intentionally, currently implemented
115 * test suites require no setup
116 */
117}
118
119static void tear_down_integ_test(void)
120{
121 /* Left empty intentionally, currently implemented
122 * test suites require no tear down
123 */
124}
125
126enum test_suite_err_t start_integ_test(void)
127{
128 enum test_suite_err_t retval;
129
130 setup_integ_test();
131 retval = integ_test("Secure", test_suites);
132 tear_down_integ_test();
133 return retval;
134}