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