blob: b7df825481aecc3c623507e2c091341d72ce38e1 [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 */
Kevin Peng62a87112020-07-07 15:07:46 +080038
39static struct test_suite_t test_suites[] = {
shejia01e0dd80a2021-07-12 17:47:50 +080040#ifdef TEST_S_PS
Kevin Peng62a87112020-07-07 15:07:46 +080041 {&register_testsuite_s_psa_ps_interface, 0, 0, 0},
42 {&register_testsuite_s_psa_ps_reliability, 0, 0, 0},
43
44#ifdef PS_TEST_NV_COUNTERS
45 {&register_testsuite_s_rollback_protection, 0, 0, 0},
46#endif
47#endif
48
shejia01e0dd80a2021-07-12 17:47:50 +080049#ifdef TEST_S_ITS
Kevin Peng62a87112020-07-07 15:07:46 +080050 /* Secure ITS test cases */
51 {&register_testsuite_s_psa_its_interface, 0, 0, 0},
52 {&register_testsuite_s_psa_its_reliability, 0, 0, 0},
53#endif
54
shejia01e0dd80a2021-07-12 17:47:50 +080055#ifdef TEST_S_CRYPTO
Kevin Peng62a87112020-07-07 15:07:46 +080056 /* Crypto test cases */
57 {&register_testsuite_s_crypto_interface, 0, 0, 0},
58#endif
59
shejia01e0dd80a2021-07-12 17:47:50 +080060#ifdef TEST_S_ATTESTATION
Kevin Peng62a87112020-07-07 15:07:46 +080061 /* Secure initial attestation service test cases */
62 {&register_testsuite_s_attestation_interface, 0, 0, 0},
63#endif
64
shejia01e0dd80a2021-07-12 17:47:50 +080065#ifdef TEST_S_PLATFORM
Kevin Peng62a87112020-07-07 15:07:46 +080066 /* Secure platform service test cases */
67 {&register_testsuite_s_platform_interface, 0, 0, 0},
68#endif
69
shejia01e0dd80a2021-07-12 17:47:50 +080070#ifdef TEST_S_AUDIT
Kevin Peng62a87112020-07-07 15:07:46 +080071 /* Secure Audit Logging test cases */
72 {&register_testsuite_s_audit_interface, 0, 0, 0},
73#endif
74
shejia01e0dd80a2021-07-12 17:47:50 +080075#ifdef TEST_S_FWU
Sherry Zhanga59fecd2021-05-24 16:37:36 +080076 /* Secure Firmware Update test cases */
Sherry Zhang92c499a2021-03-08 18:14:15 +080077 {&register_testsuite_s_psa_fwu_interface, 0, 0, 0},
78#endif
79
shejia01e0dd80a2021-07-12 17:47:50 +080080#ifdef TEST_S_IPC
Kevin Peng62a87112020-07-07 15:07:46 +080081 /* Secure IPC test cases */
82 {&register_testsuite_s_ipc_interface, 0, 0, 0},
83#endif
Kevin Peng62a87112020-07-07 15:07:46 +080084 /* End of test suites */
85 {0, 0, 0, 0}
86};
87
88static void setup_integ_test(void)
89{
90 /* Left empty intentionally, currently implemented
91 * test suites require no setup
92 */
93}
94
95static void tear_down_integ_test(void)
96{
97 /* Left empty intentionally, currently implemented
98 * test suites require no tear down
99 */
100}
101
102enum test_suite_err_t start_integ_test(void)
103{
104 enum test_suite_err_t retval;
105
106 setup_integ_test();
107 retval = integ_test("Secure", test_suites);
108 tear_down_integ_test();
109 return retval;
110}