blob: fac72995d22114dccc4f601fcd1d637bc988dfd9 [file] [log] [blame]
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +00001/*
Jamie Foxb93da8b2018-12-13 18:27:30 +00002 * Copyright (c) 2017-2019, Arm Limited. All rights reserved.
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
Tamas Banc2074a72018-08-14 10:23:12 +01008#include "test_framework_integ_test.h"
9#include "test_framework_integ_test_helper.h"
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000010#include "test_framework.h"
11
12/* Service specific includes */
13#include "test/suites/sst/non_secure/sst_ns_tests.h"
Antonio de Angelis2eeac642018-08-21 14:23:22 +010014#include "test/suites/audit/non_secure/audit_ns_tests.h"
Antonio de Angelis88c5b272018-08-31 15:48:21 +010015#include "test/suites/crypto/non_secure/crypto_ns_tests.h"
Tamas Ban229f9db2018-08-17 12:57:13 +010016#include "test/suites/attestation/non_secure/attestation_ns_tests.h"
Tamas Banaaf90392019-01-02 13:24:13 +000017#include "test/suites/qcbor/non_secure/qcbor_ns_tests.h"
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000018#include "test/suites/invert/non_secure/invert_ns_tests.h"
19#include "test/suites/core/non_secure/core_ns_tests.h"
Edison Aicf5e34c2018-06-19 18:06:54 +080020#include "test/suites/ipc/non_secure/ipc_ns_tests.h"
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000021
22static struct test_suite_t test_suites[] = {
Tamas Band90c81b2018-08-15 15:03:42 +010023#if TFM_LVL == 3
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000024#ifdef SERVICES_TEST_NS
Tamas Band90c81b2018-08-15 15:03:42 +010025 /* List test cases which compliant with level 3 isolation */
26
Tamas Banaaf90392019-01-02 13:24:13 +000027 /* Non-secure QCBOR library test cases */
28 {&register_testsuite_ns_qcbor, 0, 0, 0},
29
Tamas Band90c81b2018-08-15 15:03:42 +010030#ifdef TFM_PARTITION_TEST_CORE
31 /* Non-secure invert test cases */
32 /* Note: since this is sample code, only run if test services are enabled */
33 {&register_testsuite_ns_invert_interface, 0, 0, 0},
34#endif
35#endif /* SERVICES_TEST_NS */
36
37#else /* TFM_LVL == 3 */
38
39#ifdef SERVICES_TEST_NS
Marc Moreno Berengue3587a9f2019-01-14 15:56:46 +000040 /* List test cases which are compliant with level 1 isolation */
Jamie Foxb93da8b2018-12-13 18:27:30 +000041
Jamie Fox77924882018-12-14 17:53:46 +000042 {&register_testsuite_ns_psa_ps_interface, 0, 0, 0},
Jamie Fox06aee082017-12-18 17:00:15 +000043
Antonio de Angelis4743e672019-04-11 11:38:48 +010044 /* Non-secure Crypto test cases */
45 {&register_testsuite_ns_crypto_interface, 0, 0, 0},
46
Kevin Peng2ed30222019-04-30 09:26:11 +080047 /* Non-secure initial attestation service test cases */
48 {&register_testsuite_ns_attestation_interface, 0, 0, 0},
49
50 /* Non-secure QCBOR library test cases */
51 {&register_testsuite_ns_qcbor, 0, 0, 0},
52
Summer Qinfa085c52019-04-23 16:27:54 +080053#ifndef TFM_PSA_API
54 /*
55 * FixMe: skip below test cases temporary since target service is not
56 * IPC compatible yet.
57 */
Jamie Foxc78c62c2019-05-23 13:42:17 +010058#ifdef ENABLE_AUDIT_LOGGING_SERVICE_TESTS
Antonio de Angelis2eeac642018-08-21 14:23:22 +010059 /* Non-secure Audit Logging test cases */
60 {&register_testsuite_ns_audit_interface, 0, 0, 0},
Jamie Foxc78c62c2019-05-23 13:42:17 +010061#endif
Antonio de Angelis7852dff2018-02-07 11:15:54 +000062
Summer Qinfa085c52019-04-23 16:27:54 +080063#endif
Tamas Banaaf90392019-01-02 13:24:13 +000064
Mate Toth-Pal349714a2018-02-23 15:30:24 +010065#ifdef TFM_PARTITION_TEST_CORE
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000066 /* Non-secure invert test cases */
67 /* Note: since this is sample code, only run if test services are enabled */
68 {&register_testsuite_ns_invert_interface, 0, 0, 0},
69#endif
Tamas Band90c81b2018-08-15 15:03:42 +010070#endif /* SERVICES_TEST_NS */
71#endif /* TFM_LVL == 3 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000072
73#ifdef CORE_TEST_POSITIVE
Summer Qinfa085c52019-04-23 16:27:54 +080074#if !((TFM_LVL == 2) && defined(TFM_PSA_API))
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000075 /* Non-secure core test cases */
76 {&register_testsuite_ns_core_positive, 0, 0, 0},
77#endif
Summer Qinfa085c52019-04-23 16:27:54 +080078#endif
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000079
80#ifdef CORE_TEST_INTERACTIVE
81 /* Non-secure interactive test cases */
82 {&register_testsuite_ns_core_interactive, 0, 0, 0},
83#endif
Edison Aicf5e34c2018-06-19 18:06:54 +080084
85#ifdef CORE_TEST_IPC
86 /* Non-secure IPC test cases */
87 {&register_testsuite_ns_ipc_interface, 0, 0, 0},
88#endif
TTornblomc640e072019-06-14 14:33:51 +020089 /* End of test suites */
90 {0, 0, 0, 0}
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000091};
92
93void start_integ_test(void)
94{
TTornblomc640e072019-06-14 14:33:51 +020095 integ_test("Non-secure", test_suites);
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000096}
Ben Davis6d7256b2018-04-18 14:16:53 +010097
98/* Service stand-in for NS tests. To be called from a non-secure context */
99void tfm_non_secure_client_run_tests(void)
100{
101 start_integ_test();
102}