blob: cacd3ece038e5a35738bc2cce7bf9175d221dc36 [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"
Kevin Peng62a87112020-07-07 15:07:46 +08009#include "test_framework.h"
10
11/* Service specific includes */
shejia01e0dd80a2021-07-12 17:47:50 +080012#ifdef TEST_S_PS
Raef Coles652bb8a2020-09-24 11:27:38 +010013#include "ps_tests.h"
14#endif
shejia01e0dd80a2021-07-12 17:47:50 +080015#ifdef TEST_S_ITS
Raef Coles652bb8a2020-09-24 11:27:38 +010016#include "its_s_tests.h"
17#endif
shejia01e0dd80a2021-07-12 17:47:50 +080018#ifdef TEST_S_ATTESTATION
Raef Coles652bb8a2020-09-24 11:27:38 +010019#include "attest_s_tests.h"
20#endif
shejia01e0dd80a2021-07-12 17:47:50 +080021#ifdef TEST_S_CRYPTO
Raef Coles652bb8a2020-09-24 11:27:38 +010022#include "crypto_s_tests.h"
23#endif
shejia01e0dd80a2021-07-12 17:47:50 +080024#ifdef TEST_S_FWU
Sherry Zhang92c499a2021-03-08 18:14:15 +080025#include "fwu_s_tests.h"
26#endif
shejia01e0dd80a2021-07-12 17:47:50 +080027#ifdef TEST_S_PLATFORM
Raef Coles652bb8a2020-09-24 11:27:38 +010028#include "platform_s_tests.h"
29#endif
Kevin Penge85c6a82022-03-03 17:12:27 +080030#ifdef TEST_S_IPC
31#include "ipc_s_tests.h"
32#endif
33#ifdef TEST_S_SFN_BACKEND
34#include "sfn_s_tests.h"
35#endif
Feder Liangdb53c6b2021-09-07 15:42:09 +080036#if defined (TEST_S_FPU)
37#include "fpu_s_tests.h"
38#endif
Jianliang Shen2959c1f2021-09-01 10:14:06 +080039#ifdef EXTRA_S_TEST_SUITE
40#include "extra_s_tests.h"
41#endif
Kevin Peng62a87112020-07-07 15:07:46 +080042
43static struct test_suite_t test_suites[] = {
Kevin Peng018f7182022-03-07 14:11:20 +080044#ifdef TEST_S_IPC
45 /* Secure IPC test cases */
46 {&register_testsuite_s_ipc_interface, 0, 0, 0},
47#endif
48
49#ifdef TEST_S_SFN_BACKEND
50 /* Secure SFN backend test cases */
51 {&register_testsuite_s_sfn_interface, 0, 0, 0},
52#endif
53
shejia01e0dd80a2021-07-12 17:47:50 +080054#ifdef TEST_S_PS
Kevin Peng62a87112020-07-07 15:07:46 +080055 {&register_testsuite_s_psa_ps_interface, 0, 0, 0},
56 {&register_testsuite_s_psa_ps_reliability, 0, 0, 0},
57
58#ifdef PS_TEST_NV_COUNTERS
59 {&register_testsuite_s_rollback_protection, 0, 0, 0},
60#endif
61#endif
62
shejia01e0dd80a2021-07-12 17:47:50 +080063#ifdef TEST_S_ITS
Kevin Peng62a87112020-07-07 15:07:46 +080064 /* Secure ITS test cases */
65 {&register_testsuite_s_psa_its_interface, 0, 0, 0},
66 {&register_testsuite_s_psa_its_reliability, 0, 0, 0},
67#endif
68
shejia01e0dd80a2021-07-12 17:47:50 +080069#ifdef TEST_S_CRYPTO
Kevin Peng62a87112020-07-07 15:07:46 +080070 /* Crypto test cases */
71 {&register_testsuite_s_crypto_interface, 0, 0, 0},
72#endif
73
shejia01e0dd80a2021-07-12 17:47:50 +080074#ifdef TEST_S_ATTESTATION
Kevin Peng62a87112020-07-07 15:07:46 +080075 /* Secure initial attestation service test cases */
76 {&register_testsuite_s_attestation_interface, 0, 0, 0},
77#endif
78
shejia01e0dd80a2021-07-12 17:47:50 +080079#ifdef TEST_S_PLATFORM
Kevin Peng62a87112020-07-07 15:07:46 +080080 /* Secure platform service test cases */
81 {&register_testsuite_s_platform_interface, 0, 0, 0},
82#endif
83
shejia01e0dd80a2021-07-12 17:47:50 +080084#ifdef TEST_S_FWU
Sherry Zhanga59fecd2021-05-24 16:37:36 +080085 /* Secure Firmware Update test cases */
Sherry Zhang92c499a2021-03-08 18:14:15 +080086 {&register_testsuite_s_psa_fwu_interface, 0, 0, 0},
87#endif
88
Feder Liangdb53c6b2021-09-07 15:42:09 +080089#ifdef TEST_S_FPU
90 /* Secure FPU test cases */
91 {&register_testsuite_s_fpu_interface, 0, 0, 0},
92#endif
93
Jianliang Shen2959c1f2021-09-01 10:14:06 +080094#ifdef EXTRA_S_TEST_SUITE
95 /* Secure extra test cases */
96 {&register_testsuite_extra_s_interface, 0, 0, 0},
97#endif
98
Kevin Peng62a87112020-07-07 15:07:46 +080099 /* End of test suites */
100 {0, 0, 0, 0}
101};
102
103static void setup_integ_test(void)
104{
105 /* Left empty intentionally, currently implemented
106 * test suites require no setup
107 */
108}
109
110static void tear_down_integ_test(void)
111{
112 /* Left empty intentionally, currently implemented
113 * test suites require no tear down
114 */
115}
116
117enum test_suite_err_t start_integ_test(void)
118{
119 enum test_suite_err_t retval;
120
121 setup_integ_test();
Kevin Peng5cba1012023-11-28 15:46:01 +0800122 retval = run_test("Secure", test_suites);
Kevin Peng62a87112020-07-07 15:07:46 +0800123 tear_down_integ_test();
124 return retval;
125}