Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 1 | /* |
Sherry Zhang | 92c499a | 2021-03-08 18:14:15 +0800 | [diff] [blame] | 2 | * Copyright (c) 2017-2021, Arm Limited. All rights reserved. |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 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 Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 13 | #if defined(TFM_PARTITION_PROTECTED_STORAGE) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 14 | #include "ps_ns_tests.h" |
| 15 | #endif |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 16 | #if defined(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 17 | #include "its_ns_tests.h" |
| 18 | #endif |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 19 | #if defined(TFM_PARTITION_CRYPTO) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 20 | #include "crypto_ns_tests.h" |
| 21 | #endif |
Sherry Zhang | 92c499a | 2021-03-08 18:14:15 +0800 | [diff] [blame] | 22 | #if defined(TFM_PARTITION_FIRMWARE_UPDATE) |
| 23 | #include "fwu_ns_tests.h" |
| 24 | #endif |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 25 | #if defined(TFM_PARTITION_INITIAL_ATTESTATION) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 26 | #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 Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 32 | #if defined(TFM_PARTITION_PLATFORM) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 33 | #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 */ |
Mate Toth-Pal | b3f96d2 | 2021-05-12 08:42:34 +0200 | [diff] [blame^] | 46 | #ifdef TFM_FUZZER_TOOL_TESTS |
| 47 | #include "tf_fuzz_testsuite.h" |
| 48 | #endif /* TFM_FUZZER_TOOL_TESTS */ |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 49 | |
| 50 | static struct test_suite_t test_suites[] = { |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 51 | /* List test cases which are compliant with level 1 isolation */ |
| 52 | |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 53 | #if defined(TFM_PARTITION_PROTECTED_STORAGE) || defined(FORWARD_PROT_MSG) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 54 | {®ister_testsuite_ns_psa_ps_interface, 0, 0, 0}, |
| 55 | #endif |
| 56 | |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 57 | #if defined(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE) || defined(FORWARD_PROT_MSG) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 58 | /* Non-secure ITS test cases */ |
| 59 | {®ister_testsuite_ns_psa_its_interface, 0, 0, 0}, |
| 60 | #endif |
| 61 | |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 62 | #if defined(TFM_PARTITION_CRYPTO) || defined(FORWARD_PROT_MSG) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 63 | /* Non-secure Crypto test cases */ |
| 64 | {®ister_testsuite_ns_crypto_interface, 0, 0, 0}, |
| 65 | #endif |
| 66 | |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 67 | #if defined(TFM_PARTITION_PLATFORM) || defined(FORWARD_PROT_MSG) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 68 | /* Non-secure platform service test cases */ |
| 69 | {®ister_testsuite_ns_platform_interface, 0, 0, 0}, |
| 70 | #endif |
| 71 | |
Gabor Abonyi | b4acc0f | 2020-09-28 15:18:20 +0200 | [diff] [blame] | 72 | #if defined(TFM_PARTITION_INITIAL_ATTESTATION) || defined(FORWARD_PROT_MSG) |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 73 | /* Non-secure initial attestation service test cases */ |
| 74 | {®ister_testsuite_ns_attestation_interface, 0, 0, 0}, |
| 75 | |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 76 | /* Non-secure QCBOR library test cases */ |
| 77 | {®ister_testsuite_ns_qcbor, 0, 0, 0}, |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 78 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 79 | #ifndef SYMMETRIC_INITIAL_ATTESTATION |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 80 | /* Non-secure T_COSE library test cases */ |
| 81 | {®ister_testsuite_ns_t_cose, 0, 0, 0}, |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 82 | #endif /* !SYMMETRIC_INITIAL_ATTESTATION */ |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 83 | #endif |
| 84 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 85 | #ifdef TFM_PARTITION_AUDIT_LOG |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 86 | /* Non-secure Audit Logging test cases */ |
| 87 | {®ister_testsuite_ns_audit_interface, 0, 0, 0}, |
| 88 | #endif |
| 89 | |
Sherry Zhang | 92c499a | 2021-03-08 18:14:15 +0800 | [diff] [blame] | 90 | #ifdef TFM_PARTITION_FIRMWARE_UPDATE |
| 91 | /* Non-secure Firmware Update test cases */ |
| 92 | {®ister_testsuite_ns_psa_fwu_interface, 0, 0, 0}, |
| 93 | #endif |
| 94 | |
Raef Coles | ce57e06 | 2020-10-02 10:39:41 +0100 | [diff] [blame] | 95 | /* Non-secure core test cases */ |
| 96 | {®ister_testsuite_ns_core_positive, 0, 0, 0}, |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 97 | |
| 98 | #ifdef CORE_TEST_INTERACTIVE |
| 99 | /* Non-secure interactive test cases */ |
| 100 | {®ister_testsuite_ns_core_interactive, 0, 0, 0}, |
| 101 | #endif |
| 102 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 103 | #ifdef TFM_PSA_API |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 104 | /* Non-secure IPC test cases */ |
| 105 | {®ister_testsuite_ns_ipc_interface, 0, 0, 0}, |
| 106 | #endif |
| 107 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 108 | #ifdef TFM_MULTI_CORE_TOPOLOGY |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 109 | /* Multi-core topology test cases */ |
| 110 | {®ister_testsuite_multi_core_ns_interface, 0, 0, 0}, |
| 111 | #endif |
| 112 | |
Mate Toth-Pal | b3f96d2 | 2021-05-12 08:42:34 +0200 | [diff] [blame^] | 113 | #ifdef TFM_FUZZER_TOOL_TESTS |
| 114 | {®ister_testsuite_tf_fuzz_test, 0, 0, 0}, |
| 115 | #endif /* TFM_FUZZER_TOOL_TESTS */ |
| 116 | |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 117 | /* End of test suites */ |
| 118 | {0, 0, 0, 0} |
| 119 | }; |
| 120 | |
| 121 | enum test_suite_err_t start_integ_test(void) |
| 122 | { |
| 123 | return integ_test("Non-secure", test_suites); |
| 124 | } |
| 125 | |
| 126 | /* Service stand-in for NS tests. To be called from a non-secure context */ |
| 127 | enum test_suite_err_t tfm_non_secure_client_run_tests(void) |
| 128 | { |
| 129 | return start_integ_test(); |
| 130 | } |