blob: 5464ac8fa718ec4f43c07969e542a6f0aada628a [file] [log] [blame]
Kevin Peng62a87112020-07-07 15:07:46 +08001/*
2 * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
3 *
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 */
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020013#if defined(TFM_PARTITION_PROTECTED_STORAGE) || defined(FORWARD_PROT_MSG)
Raef Coles652bb8a2020-09-24 11:27:38 +010014#include "ps_tests.h"
15#endif
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020016#if defined(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) || defined(FORWARD_PROT_MSG)
Raef Coles652bb8a2020-09-24 11:27:38 +010017#include "its_s_tests.h"
18#endif
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020019#if defined(TFM_PARTITION_INITIAL_ATTESTATION) || defined(FORWARD_PROT_MSG)
Raef Coles652bb8a2020-09-24 11:27:38 +010020#include "attest_s_tests.h"
21#endif
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020022#if defined(TFM_PARTITION_CRYPTO) || defined(FORWARD_PROT_MSG)
Raef Coles652bb8a2020-09-24 11:27:38 +010023#include "crypto_s_tests.h"
24#endif
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020025#if defined(TFM_PARTITION_PLATFORM) || defined(FORWARD_PROT_MSG)
Raef Coles652bb8a2020-09-24 11:27:38 +010026#include "platform_s_tests.h"
27#endif
28#ifdef TFM_PSA_API
29#include "ipc_s_tests.h"
30#else
31#ifdef TFM_PARTITION_AUDIT_LOG
32#include "audit_s_tests.h"
33#endif
34#endif /* TFM_PSA_API */
Kevin Peng62a87112020-07-07 15:07:46 +080035
36static struct test_suite_t test_suites[] = {
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020037#if defined(TFM_PARTITION_PROTECTED_STORAGE) || defined(FORWARD_PROT_MSG)
Kevin Peng62a87112020-07-07 15:07:46 +080038 {&register_testsuite_s_psa_ps_interface, 0, 0, 0},
39 {&register_testsuite_s_psa_ps_reliability, 0, 0, 0},
40
41#ifdef PS_TEST_NV_COUNTERS
42 {&register_testsuite_s_rollback_protection, 0, 0, 0},
43#endif
44#endif
45
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020046#if defined(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) || defined(FORWARD_PROT_MSG)
Kevin Peng62a87112020-07-07 15:07:46 +080047 /* Secure ITS test cases */
48 {&register_testsuite_s_psa_its_interface, 0, 0, 0},
49 {&register_testsuite_s_psa_its_reliability, 0, 0, 0},
50#endif
51
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020052#if defined(TFM_PARTITION_CRYPTO) || defined(FORWARD_PROT_MSG)
Kevin Peng62a87112020-07-07 15:07:46 +080053 /* Crypto test cases */
54 {&register_testsuite_s_crypto_interface, 0, 0, 0},
55#endif
56
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020057#if defined(TFM_PARTITION_INITIAL_ATTESTATION) || defined(FORWARD_PROT_MSG)
Kevin Peng62a87112020-07-07 15:07:46 +080058 /* Secure initial attestation service test cases */
59 {&register_testsuite_s_attestation_interface, 0, 0, 0},
60#endif
61
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020062#if defined(TFM_PARTITION_PLATFORM) || defined(FORWARD_PROT_MSG)
Kevin Peng62a87112020-07-07 15:07:46 +080063 /* Secure platform service test cases */
64 {&register_testsuite_s_platform_interface, 0, 0, 0},
65#endif
66
Raef Coles652bb8a2020-09-24 11:27:38 +010067#ifdef TFM_PARTITION_AUDIT_LOG
Kevin Peng62a87112020-07-07 15:07:46 +080068 /* Secure Audit Logging test cases */
69 {&register_testsuite_s_audit_interface, 0, 0, 0},
70#endif
71
Kevin Peng43731612020-11-06 14:34:08 +080072#ifdef TFM_PSA_API
Kevin Peng62a87112020-07-07 15:07:46 +080073 /* Secure IPC test cases */
74 {&register_testsuite_s_ipc_interface, 0, 0, 0},
75#endif
Kevin Peng62a87112020-07-07 15:07:46 +080076 /* End of test suites */
77 {0, 0, 0, 0}
78};
79
80static void setup_integ_test(void)
81{
82 /* Left empty intentionally, currently implemented
83 * test suites require no setup
84 */
85}
86
87static void tear_down_integ_test(void)
88{
89 /* Left empty intentionally, currently implemented
90 * test suites require no tear down
91 */
92}
93
94enum test_suite_err_t start_integ_test(void)
95{
96 enum test_suite_err_t retval;
97
98 setup_integ_test();
99 retval = integ_test("Secure", test_suites);
100 tear_down_integ_test();
101 return retval;
102}