blob: 0d29063499356b63edabcf4b9e6ae385f227dadf [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 */
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_ns_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_ns_tests.h"
18#endif
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020019#if defined(TFM_PARTITION_CRYPTO) || defined(FORWARD_PROT_MSG)
Raef Coles652bb8a2020-09-24 11:27:38 +010020#include "crypto_ns_tests.h"
21#endif
Sherry Zhang92c499a2021-03-08 18:14:15 +080022#if defined(TFM_PARTITION_FIRMWARE_UPDATE)
23#include "fwu_ns_tests.h"
24#endif
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020025#if defined(TFM_PARTITION_INITIAL_ATTESTATION) || defined(FORWARD_PROT_MSG)
Raef Coles652bb8a2020-09-24 11:27:38 +010026#include "attest_ns_tests.h"
27#include "qcbor_ns_tests.h"
28#ifndef SYMMETRIC_INITIAL_ATTESTATION
29#include "t_cose_ns_tests.h"
30#endif /* !SYMMETRIC_INITIAL_ATTESTATION */
31#endif
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020032#if defined(TFM_PARTITION_PLATFORM) || defined(FORWARD_PROT_MSG)
Raef Coles652bb8a2020-09-24 11:27:38 +010033#include "platform_ns_tests.h"
34#endif
35#include "core_ns_tests.h"
36#ifdef TFM_PSA_API
37#include "ipc_ns_tests.h"
38#else
39#ifdef TFM_PARTITION_AUDIT_LOG
40#include "audit_ns_tests.h"
41#endif
42#endif /* TFM_PSA_API */
43#ifdef TFM_MULTI_CORE_TOPOLOGY
44#include "multi_core_ns_test.h"
45#endif /* TFM_MULTI_CORE_TOPOLOGY */
Kevin Peng62a87112020-07-07 15:07:46 +080046
47static struct test_suite_t test_suites[] = {
Kevin Peng62a87112020-07-07 15:07:46 +080048 /* List test cases which are compliant with level 1 isolation */
49
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020050#if defined(TFM_PARTITION_PROTECTED_STORAGE) || defined(FORWARD_PROT_MSG)
Kevin Peng62a87112020-07-07 15:07:46 +080051 {&register_testsuite_ns_psa_ps_interface, 0, 0, 0},
52#endif
53
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020054#if defined(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) || defined(FORWARD_PROT_MSG)
Kevin Peng62a87112020-07-07 15:07:46 +080055 /* Non-secure ITS test cases */
56 {&register_testsuite_ns_psa_its_interface, 0, 0, 0},
57#endif
58
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020059#if defined(TFM_PARTITION_CRYPTO) || defined(FORWARD_PROT_MSG)
Kevin Peng62a87112020-07-07 15:07:46 +080060 /* Non-secure Crypto test cases */
61 {&register_testsuite_ns_crypto_interface, 0, 0, 0},
62#endif
63
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020064#if defined(TFM_PARTITION_PLATFORM) || defined(FORWARD_PROT_MSG)
Kevin Peng62a87112020-07-07 15:07:46 +080065 /* Non-secure platform service test cases */
66 {&register_testsuite_ns_platform_interface, 0, 0, 0},
67#endif
68
Gabor Abonyib4acc0f2020-09-28 15:18:20 +020069#if defined(TFM_PARTITION_INITIAL_ATTESTATION) || defined(FORWARD_PROT_MSG)
Raef Coles652bb8a2020-09-24 11:27:38 +010070 /* Non-secure initial attestation service test cases */
71 {&register_testsuite_ns_attestation_interface, 0, 0, 0},
72
Kevin Peng62a87112020-07-07 15:07:46 +080073 /* Non-secure QCBOR library test cases */
74 {&register_testsuite_ns_qcbor, 0, 0, 0},
Kevin Peng62a87112020-07-07 15:07:46 +080075
Raef Coles652bb8a2020-09-24 11:27:38 +010076#ifndef SYMMETRIC_INITIAL_ATTESTATION
Kevin Peng62a87112020-07-07 15:07:46 +080077 /* Non-secure T_COSE library test cases */
78 {&register_testsuite_ns_t_cose, 0, 0, 0},
Raef Coles652bb8a2020-09-24 11:27:38 +010079#endif /* !SYMMETRIC_INITIAL_ATTESTATION */
Kevin Peng62a87112020-07-07 15:07:46 +080080#endif
81
Raef Coles652bb8a2020-09-24 11:27:38 +010082#ifdef TFM_PARTITION_AUDIT_LOG
Kevin Peng62a87112020-07-07 15:07:46 +080083 /* Non-secure Audit Logging test cases */
84 {&register_testsuite_ns_audit_interface, 0, 0, 0},
85#endif
86
Sherry Zhang92c499a2021-03-08 18:14:15 +080087#ifdef TFM_PARTITION_FIRMWARE_UPDATE
88 /* Non-secure Firmware Update test cases */
89 {&register_testsuite_ns_psa_fwu_interface, 0, 0, 0},
90#endif
91
Raef Colesce57e062020-10-02 10:39:41 +010092/* Non-secure core test cases */
93{&register_testsuite_ns_core_positive, 0, 0, 0},
Kevin Peng62a87112020-07-07 15:07:46 +080094
95#ifdef CORE_TEST_INTERACTIVE
96 /* Non-secure interactive test cases */
97 {&register_testsuite_ns_core_interactive, 0, 0, 0},
98#endif
99
Raef Coles652bb8a2020-09-24 11:27:38 +0100100#ifdef TFM_PSA_API
Kevin Peng62a87112020-07-07 15:07:46 +0800101 /* Non-secure IPC test cases */
102 {&register_testsuite_ns_ipc_interface, 0, 0, 0},
103#endif
104
Raef Coles652bb8a2020-09-24 11:27:38 +0100105#ifdef TFM_MULTI_CORE_TOPOLOGY
Kevin Peng62a87112020-07-07 15:07:46 +0800106 /* Multi-core topology test cases */
107 {&register_testsuite_multi_core_ns_interface, 0, 0, 0},
108#endif
109
110 /* End of test suites */
111 {0, 0, 0, 0}
112};
113
114enum test_suite_err_t start_integ_test(void)
115{
116 return integ_test("Non-secure", test_suites);
117}
118
119/* Service stand-in for NS tests. To be called from a non-secure context */
120enum test_suite_err_t tfm_non_secure_client_run_tests(void)
121{
122 return start_integ_test();
123}