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_tests.h" |
| 15 | #endif |
| 16 | #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE |
| 17 | #include "its_s_tests.h" |
| 18 | #endif |
| 19 | #ifdef TFM_PARTITION_INITIAL_ATTESTATION |
| 20 | #include "attest_s_tests.h" |
| 21 | #endif |
| 22 | #ifdef TFM_PARTITION_CRYPTO |
| 23 | #include "crypto_s_tests.h" |
| 24 | #endif |
| 25 | #ifdef TFM_PARTITION_PLATFORM |
| 26 | #include "platform_s_tests.h" |
| 27 | #endif |
| 28 | #ifdef TFM_PSA_API |
| 29 | #include "ipc_s_tests.h" |
| 30 | #else |
| 31 | #ifdef TFM_PARTITION_AUDIT_LOG |
| 32 | #include "audit_s_tests.h" |
| 33 | #endif |
| 34 | #endif /* TFM_PSA_API */ |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 35 | |
| 36 | static struct test_suite_t test_suites[] = { |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 37 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 38 | #ifdef TFM_PARTITION_PROTECTED_STORAGE |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 39 | {®ister_testsuite_s_psa_ps_interface, 0, 0, 0}, |
| 40 | {®ister_testsuite_s_psa_ps_reliability, 0, 0, 0}, |
| 41 | |
| 42 | #ifdef PS_TEST_NV_COUNTERS |
| 43 | {®ister_testsuite_s_rollback_protection, 0, 0, 0}, |
| 44 | #endif |
| 45 | #endif |
| 46 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 47 | #ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 48 | /* Secure ITS test cases */ |
| 49 | {®ister_testsuite_s_psa_its_interface, 0, 0, 0}, |
| 50 | {®ister_testsuite_s_psa_its_reliability, 0, 0, 0}, |
| 51 | #endif |
| 52 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 53 | #ifdef TFM_PARTITION_CRYPTO |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 54 | /* Crypto test cases */ |
| 55 | {®ister_testsuite_s_crypto_interface, 0, 0, 0}, |
| 56 | #endif |
| 57 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 58 | #ifdef TFM_PARTITION_INITIAL_ATTESTATION |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 59 | /* Secure initial attestation service test cases */ |
| 60 | {®ister_testsuite_s_attestation_interface, 0, 0, 0}, |
| 61 | #endif |
| 62 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 63 | #ifdef TFM_PARTITION_PLATFORM |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 64 | /* Secure platform service test cases */ |
| 65 | {®ister_testsuite_s_platform_interface, 0, 0, 0}, |
| 66 | #endif |
| 67 | |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame^] | 68 | #ifdef TFM_PARTITION_AUDIT_LOG |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 69 | /* Secure Audit Logging test cases */ |
| 70 | {®ister_testsuite_s_audit_interface, 0, 0, 0}, |
| 71 | #endif |
| 72 | |
| 73 | #ifdef ENABLE_IPC_TEST |
| 74 | /* Secure IPC test cases */ |
| 75 | {®ister_testsuite_s_ipc_interface, 0, 0, 0}, |
| 76 | #endif |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 77 | /* End of test suites */ |
| 78 | {0, 0, 0, 0} |
| 79 | }; |
| 80 | |
| 81 | static void setup_integ_test(void) |
| 82 | { |
| 83 | /* Left empty intentionally, currently implemented |
| 84 | * test suites require no setup |
| 85 | */ |
| 86 | } |
| 87 | |
| 88 | static void tear_down_integ_test(void) |
| 89 | { |
| 90 | /* Left empty intentionally, currently implemented |
| 91 | * test suites require no tear down |
| 92 | */ |
| 93 | } |
| 94 | |
| 95 | enum test_suite_err_t start_integ_test(void) |
| 96 | { |
| 97 | enum test_suite_err_t retval; |
| 98 | |
| 99 | setup_integ_test(); |
| 100 | retval = integ_test("Secure", test_suites); |
| 101 | tear_down_integ_test(); |
| 102 | return retval; |
| 103 | } |