Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 1 | /* |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2019, Arm Limited. All rights reserved. |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
Tamas Ban | c2074a7 | 2018-08-14 10:23:12 +0100 | [diff] [blame] | 8 | #include "test_framework_integ_test.h" |
| 9 | #include "test_framework_integ_test_helper.h" |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 10 | #include "test_framework.h" |
| 11 | |
| 12 | /* Service specific includes */ |
| 13 | #include "test/suites/sst/non_secure/sst_ns_tests.h" |
Antonio de Angelis | 2eeac64 | 2018-08-21 14:23:22 +0100 | [diff] [blame] | 14 | #include "test/suites/audit/non_secure/audit_ns_tests.h" |
Antonio de Angelis | 88c5b27 | 2018-08-31 15:48:21 +0100 | [diff] [blame] | 15 | #include "test/suites/crypto/non_secure/crypto_ns_tests.h" |
Tamas Ban | 229f9db | 2018-08-17 12:57:13 +0100 | [diff] [blame] | 16 | #include "test/suites/attestation/non_secure/attestation_ns_tests.h" |
Tamas Ban | aaf9039 | 2019-01-02 13:24:13 +0000 | [diff] [blame] | 17 | #include "test/suites/qcbor/non_secure/qcbor_ns_tests.h" |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 18 | #include "test/suites/invert/non_secure/invert_ns_tests.h" |
| 19 | #include "test/suites/core/non_secure/core_ns_tests.h" |
Edison Ai | cf5e34c | 2018-06-19 18:06:54 +0800 | [diff] [blame] | 20 | #include "test/suites/ipc/non_secure/ipc_ns_tests.h" |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 21 | |
| 22 | static struct test_suite_t test_suites[] = { |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 23 | #if TFM_LVL == 3 |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 24 | #ifdef SERVICES_TEST_NS |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 25 | /* List test cases which compliant with level 3 isolation */ |
| 26 | |
Tamas Ban | aaf9039 | 2019-01-02 13:24:13 +0000 | [diff] [blame] | 27 | /* Non-secure QCBOR library test cases */ |
| 28 | {®ister_testsuite_ns_qcbor, 0, 0, 0}, |
| 29 | |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 30 | #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 | {®ister_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 Berengue | 3587a9f | 2019-01-14 15:56:46 +0000 | [diff] [blame] | 40 | /* List test cases which are compliant with level 1 isolation */ |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame] | 41 | |
Jamie Fox | 7792488 | 2018-12-14 17:53:46 +0000 | [diff] [blame] | 42 | {®ister_testsuite_ns_psa_ps_interface, 0, 0, 0}, |
Jamie Fox | 06aee08 | 2017-12-18 17:00:15 +0000 | [diff] [blame] | 43 | |
Antonio de Angelis | 4743e67 | 2019-04-11 11:38:48 +0100 | [diff] [blame^] | 44 | /* Non-secure Crypto test cases */ |
| 45 | {®ister_testsuite_ns_crypto_interface, 0, 0, 0}, |
| 46 | |
Summer Qin | fa085c5 | 2019-04-23 16:27:54 +0800 | [diff] [blame] | 47 | #ifndef TFM_PSA_API |
| 48 | /* |
| 49 | * FixMe: skip below test cases temporary since target service is not |
| 50 | * IPC compatible yet. |
| 51 | */ |
Antonio de Angelis | 2eeac64 | 2018-08-21 14:23:22 +0100 | [diff] [blame] | 52 | /* Non-secure Audit Logging test cases */ |
| 53 | {®ister_testsuite_ns_audit_interface, 0, 0, 0}, |
Antonio de Angelis | 7852dff | 2018-02-07 11:15:54 +0000 | [diff] [blame] | 54 | |
Tamas Ban | 229f9db | 2018-08-17 12:57:13 +0100 | [diff] [blame] | 55 | /* Non-secure initial attestation service test cases */ |
| 56 | {®ister_testsuite_ns_attestation_interface, 0, 0, 0}, |
| 57 | |
Tamas Ban | aaf9039 | 2019-01-02 13:24:13 +0000 | [diff] [blame] | 58 | /* Non-secure QCBOR library test cases */ |
| 59 | {®ister_testsuite_ns_qcbor, 0, 0, 0}, |
Summer Qin | fa085c5 | 2019-04-23 16:27:54 +0800 | [diff] [blame] | 60 | #endif |
Tamas Ban | aaf9039 | 2019-01-02 13:24:13 +0000 | [diff] [blame] | 61 | |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 62 | #ifdef TFM_PARTITION_TEST_CORE |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 63 | /* Non-secure invert test cases */ |
| 64 | /* Note: since this is sample code, only run if test services are enabled */ |
| 65 | {®ister_testsuite_ns_invert_interface, 0, 0, 0}, |
| 66 | #endif |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 67 | #endif /* SERVICES_TEST_NS */ |
| 68 | #endif /* TFM_LVL == 3 */ |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 69 | |
| 70 | #ifdef CORE_TEST_POSITIVE |
Summer Qin | fa085c5 | 2019-04-23 16:27:54 +0800 | [diff] [blame] | 71 | #if !((TFM_LVL == 2) && defined(TFM_PSA_API)) |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 72 | /* Non-secure core test cases */ |
| 73 | {®ister_testsuite_ns_core_positive, 0, 0, 0}, |
| 74 | #endif |
Summer Qin | fa085c5 | 2019-04-23 16:27:54 +0800 | [diff] [blame] | 75 | #endif |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 76 | |
| 77 | #ifdef CORE_TEST_INTERACTIVE |
| 78 | /* Non-secure interactive test cases */ |
| 79 | {®ister_testsuite_ns_core_interactive, 0, 0, 0}, |
| 80 | #endif |
Edison Ai | cf5e34c | 2018-06-19 18:06:54 +0800 | [diff] [blame] | 81 | |
| 82 | #ifdef CORE_TEST_IPC |
| 83 | /* Non-secure IPC test cases */ |
| 84 | {®ister_testsuite_ns_ipc_interface, 0, 0, 0}, |
| 85 | #endif |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 86 | }; |
| 87 | |
| 88 | void start_integ_test(void) |
| 89 | { |
| 90 | integ_test("Non-secure", test_suites, |
| 91 | sizeof(test_suites)/sizeof(test_suites[0])); |
| 92 | } |
Ben Davis | 6d7256b | 2018-04-18 14:16:53 +0100 | [diff] [blame] | 93 | |
| 94 | /* Service stand-in for NS tests. To be called from a non-secure context */ |
| 95 | void tfm_non_secure_client_run_tests(void) |
| 96 | { |
| 97 | start_integ_test(); |
| 98 | } |