blob: bbe36760968b3cdfb41c3c320144a10d2807d9ef [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 */
Jianliang Shen2959c1f2021-09-01 10:14:06 +080038#ifdef EXTRA_S_TEST_SUITE
39#include "extra_s_tests.h"
40#endif
Kevin Peng62a87112020-07-07 15:07:46 +080041
42static struct test_suite_t test_suites[] = {
shejia01e0dd80a2021-07-12 17:47:50 +080043#ifdef TEST_S_PS
Kevin Peng62a87112020-07-07 15:07:46 +080044 {&register_testsuite_s_psa_ps_interface, 0, 0, 0},
45 {&register_testsuite_s_psa_ps_reliability, 0, 0, 0},
46
47#ifdef PS_TEST_NV_COUNTERS
48 {&register_testsuite_s_rollback_protection, 0, 0, 0},
49#endif
50#endif
51
shejia01e0dd80a2021-07-12 17:47:50 +080052#ifdef TEST_S_ITS
Kevin Peng62a87112020-07-07 15:07:46 +080053 /* Secure ITS test cases */
54 {&register_testsuite_s_psa_its_interface, 0, 0, 0},
55 {&register_testsuite_s_psa_its_reliability, 0, 0, 0},
56#endif
57
shejia01e0dd80a2021-07-12 17:47:50 +080058#ifdef TEST_S_CRYPTO
Kevin Peng62a87112020-07-07 15:07:46 +080059 /* Crypto test cases */
60 {&register_testsuite_s_crypto_interface, 0, 0, 0},
61#endif
62
shejia01e0dd80a2021-07-12 17:47:50 +080063#ifdef TEST_S_ATTESTATION
Kevin Peng62a87112020-07-07 15:07:46 +080064 /* Secure initial attestation service test cases */
65 {&register_testsuite_s_attestation_interface, 0, 0, 0},
66#endif
67
shejia01e0dd80a2021-07-12 17:47:50 +080068#ifdef TEST_S_PLATFORM
Kevin Peng62a87112020-07-07 15:07:46 +080069 /* Secure platform service test cases */
70 {&register_testsuite_s_platform_interface, 0, 0, 0},
71#endif
72
shejia01e0dd80a2021-07-12 17:47:50 +080073#ifdef TEST_S_AUDIT
Kevin Peng62a87112020-07-07 15:07:46 +080074 /* Secure Audit Logging test cases */
75 {&register_testsuite_s_audit_interface, 0, 0, 0},
76#endif
77
shejia01e0dd80a2021-07-12 17:47:50 +080078#ifdef TEST_S_FWU
Sherry Zhanga59fecd2021-05-24 16:37:36 +080079 /* Secure Firmware Update test cases */
Sherry Zhang92c499a2021-03-08 18:14:15 +080080 {&register_testsuite_s_psa_fwu_interface, 0, 0, 0},
81#endif
82
shejia01e0dd80a2021-07-12 17:47:50 +080083#ifdef TEST_S_IPC
Kevin Peng62a87112020-07-07 15:07:46 +080084 /* Secure IPC test cases */
85 {&register_testsuite_s_ipc_interface, 0, 0, 0},
86#endif
Jianliang Shen2959c1f2021-09-01 10:14:06 +080087
88#ifdef EXTRA_S_TEST_SUITE
89 /* Secure extra test cases */
90 {&register_testsuite_extra_s_interface, 0, 0, 0},
91#endif
92
Kevin Peng62a87112020-07-07 15:07:46 +080093 /* End of test suites */
94 {0, 0, 0, 0}
95};
96
97static void setup_integ_test(void)
98{
99 /* Left empty intentionally, currently implemented
100 * test suites require no setup
101 */
102}
103
104static void tear_down_integ_test(void)
105{
106 /* Left empty intentionally, currently implemented
107 * test suites require no tear down
108 */
109}
110
111enum test_suite_err_t start_integ_test(void)
112{
113 enum test_suite_err_t retval;
114
115 setup_integ_test();
116 retval = integ_test("Secure", test_suites);
117 tear_down_integ_test();
118 return retval;
119}