Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 1 | /* |
| 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 */ |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 13 | #ifdef TFM_PARTITION_PROTECTED_STORAGE |
| 14 | #include "ps_ns_tests.h" |
| 15 | #endif |
| 16 | #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE |
| 17 | #include "its_ns_tests.h" |
| 18 | #endif |
| 19 | #ifdef TFM_PARTITION_CRYPTO |
| 20 | #include "crypto_ns_tests.h" |
| 21 | #endif |
| 22 | #ifdef TFM_PARTITION_INITIAL_ATTESTATION |
| 23 | #include "attest_ns_tests.h" |
| 24 | #include "qcbor_ns_tests.h" |
| 25 | #ifndef SYMMETRIC_INITIAL_ATTESTATION |
| 26 | #include "t_cose_ns_tests.h" |
| 27 | #endif /* !SYMMETRIC_INITIAL_ATTESTATION */ |
| 28 | #endif |
| 29 | #ifdef TFM_PARTITION_PLATFORM |
| 30 | #include "platform_ns_tests.h" |
| 31 | #endif |
| 32 | #include "core_ns_tests.h" |
| 33 | #ifdef TFM_PSA_API |
| 34 | #include "ipc_ns_tests.h" |
| 35 | #else |
| 36 | #ifdef TFM_PARTITION_AUDIT_LOG |
| 37 | #include "audit_ns_tests.h" |
| 38 | #endif |
| 39 | #endif /* TFM_PSA_API */ |
| 40 | #ifdef TFM_MULTI_CORE_TOPOLOGY |
| 41 | #include "multi_core_ns_test.h" |
| 42 | #endif /* TFM_MULTI_CORE_TOPOLOGY */ |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 43 | |
| 44 | static struct test_suite_t test_suites[] = { |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 45 | /* List test cases which are compliant with level 1 isolation */ |
| 46 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 47 | #ifdef TFM_PARTITION_PROTECTED_STORAGE |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 48 | {®ister_testsuite_ns_psa_ps_interface, 0, 0, 0}, |
| 49 | #endif |
| 50 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 51 | #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 52 | /* Non-secure ITS test cases */ |
| 53 | {®ister_testsuite_ns_psa_its_interface, 0, 0, 0}, |
| 54 | #endif |
| 55 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 56 | #ifdef TFM_PARTITION_CRYPTO |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 57 | /* Non-secure Crypto test cases */ |
| 58 | {®ister_testsuite_ns_crypto_interface, 0, 0, 0}, |
| 59 | #endif |
| 60 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 61 | #ifdef TFM_PARTITION_PLATFORM |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 62 | /* Non-secure platform service test cases */ |
| 63 | {®ister_testsuite_ns_platform_interface, 0, 0, 0}, |
| 64 | #endif |
| 65 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 66 | #ifdef TFM_PARTITION_INITIAL_ATTESTATION |
| 67 | /* Non-secure initial attestation service test cases */ |
| 68 | {®ister_testsuite_ns_attestation_interface, 0, 0, 0}, |
| 69 | |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 70 | /* Non-secure QCBOR library test cases */ |
| 71 | {®ister_testsuite_ns_qcbor, 0, 0, 0}, |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 72 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 73 | #ifndef SYMMETRIC_INITIAL_ATTESTATION |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 74 | /* Non-secure T_COSE library test cases */ |
| 75 | {®ister_testsuite_ns_t_cose, 0, 0, 0}, |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 76 | #endif /* !SYMMETRIC_INITIAL_ATTESTATION */ |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 77 | #endif |
| 78 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 79 | #ifdef TFM_PARTITION_AUDIT_LOG |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 80 | /* Non-secure Audit Logging test cases */ |
| 81 | {®ister_testsuite_ns_audit_interface, 0, 0, 0}, |
| 82 | #endif |
| 83 | |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 84 | #ifdef CORE_TEST_POSITIVE |
| 85 | /* Non-secure core test cases */ |
| 86 | {®ister_testsuite_ns_core_positive, 0, 0, 0}, |
| 87 | #endif |
| 88 | |
| 89 | #ifdef CORE_TEST_INTERACTIVE |
| 90 | /* Non-secure interactive test cases */ |
| 91 | {®ister_testsuite_ns_core_interactive, 0, 0, 0}, |
| 92 | #endif |
| 93 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 94 | #ifdef TFM_PSA_API |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 95 | /* Non-secure IPC test cases */ |
| 96 | {®ister_testsuite_ns_ipc_interface, 0, 0, 0}, |
| 97 | #endif |
| 98 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 99 | #ifdef TFM_MULTI_CORE_TOPOLOGY |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 100 | /* Multi-core topology test cases */ |
| 101 | {®ister_testsuite_multi_core_ns_interface, 0, 0, 0}, |
| 102 | #endif |
| 103 | |
| 104 | /* End of test suites */ |
| 105 | {0, 0, 0, 0} |
| 106 | }; |
| 107 | |
| 108 | enum test_suite_err_t start_integ_test(void) |
| 109 | { |
| 110 | return integ_test("Non-secure", test_suites); |
| 111 | } |
| 112 | |
| 113 | /* Service stand-in for NS tests. To be called from a non-secure context */ |
| 114 | enum test_suite_err_t tfm_non_secure_client_run_tests(void) |
| 115 | { |
| 116 | return start_integ_test(); |
| 117 | } |