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/secure/sst_tests.h" |
Antonio de Angelis | 2eeac64 | 2018-08-21 14:23:22 +0100 | [diff] [blame] | 14 | #include "test/suites/audit/secure/audit_s_tests.h" |
Tamas Ban | 229f9db | 2018-08-17 12:57:13 +0100 | [diff] [blame] | 15 | #include "test/suites/attestation/secure/attestation_s_tests.h" |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 16 | #include "test/suites/invert/secure/invert_s_tests.h" |
Antonio de Angelis | 88c5b27 | 2018-08-31 15:48:21 +0100 | [diff] [blame] | 17 | #include "test/suites/crypto/secure/crypto_s_tests.h" |
Edison Ai | cf5e34c | 2018-06-19 18:06:54 +0800 | [diff] [blame] | 18 | #include "test/suites/ipc/secure/ipc_s_tests.h" |
Antonio de Angelis | 88c5b27 | 2018-08-31 15:48:21 +0100 | [diff] [blame] | 19 | |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 20 | static struct test_suite_t test_suites[] = { |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 21 | #if TFM_LVL == 3 |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 22 | #ifdef SERVICES_TEST_S |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 23 | /* List test cases which compliant with level 3 isolation */ |
| 24 | #endif /* SERVICES_TEST_S */ |
| 25 | |
| 26 | #else /* TFM_LVL == 3 */ |
| 27 | |
| 28 | #ifdef SERVICES_TEST_S |
Marc Moreno Berengue | 3587a9f | 2019-01-14 15:56:46 +0000 | [diff] [blame] | 29 | /* List test cases which are compliant with level 1 isolation */ |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame] | 30 | |
Jamie Fox | ece411c | 2019-01-08 13:29:34 +0000 | [diff] [blame] | 31 | {®ister_testsuite_s_psa_ps_interface, 0, 0, 0}, |
Marc Moreno Berengue | 32ee426 | 2019-01-14 11:30:46 +0000 | [diff] [blame] | 32 | {®ister_testsuite_s_psa_ps_reliability, 0, 0, 0}, |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 33 | |
Jamie Fox | 95bacd4 | 2019-03-21 18:14:15 +0000 | [diff] [blame] | 34 | #ifdef SST_TEST_NV_COUNTERS |
Marc Moreno Berengue | 42e74b4 | 2018-08-15 14:28:45 +0100 | [diff] [blame] | 35 | {®ister_testsuite_s_rollback_protection, 0, 0, 0}, |
| 36 | #endif |
Marc Moreno Berengue | f8428f0 | 2019-01-14 14:50:09 +0000 | [diff] [blame] | 37 | |
Antonio de Angelis | 4743e67 | 2019-04-11 11:38:48 +0100 | [diff] [blame] | 38 | /* Crypto test cases */ |
| 39 | {®ister_testsuite_s_crypto_interface, 0, 0, 0}, |
| 40 | |
Kevin Peng | 2ed3022 | 2019-04-30 09:26:11 +0800 | [diff] [blame] | 41 | /* Secure initial attestation service test cases */ |
| 42 | {®ister_testsuite_s_attestation_interface, 0, 0, 0}, |
| 43 | |
Summer Qin | fa085c5 | 2019-04-23 16:27:54 +0800 | [diff] [blame] | 44 | #ifndef TFM_PSA_API |
| 45 | /* |
| 46 | * FixMe: since the following partitions haven't implement the IPC model, |
| 47 | * they will block the process. Skip them in IPC model. |
| 48 | */ |
Jamie Fox | c78c62c | 2019-05-23 13:42:17 +0100 | [diff] [blame] | 49 | #ifdef ENABLE_AUDIT_LOGGING_SERVICE_TESTS |
Antonio de Angelis | 2eeac64 | 2018-08-21 14:23:22 +0100 | [diff] [blame] | 50 | /* Secure Audit Logging test cases */ |
| 51 | {®ister_testsuite_s_audit_interface, 0, 0, 0}, |
Jamie Fox | c78c62c | 2019-05-23 13:42:17 +0100 | [diff] [blame] | 52 | #endif |
Antonio de Angelis | 7852dff | 2018-02-07 11:15:54 +0000 | [diff] [blame] | 53 | |
Summer Qin | fa085c5 | 2019-04-23 16:27:54 +0800 | [diff] [blame] | 54 | #endif |
Tamas Ban | 229f9db | 2018-08-17 12:57:13 +0100 | [diff] [blame] | 55 | |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 56 | #ifdef TFM_PARTITION_TEST_CORE |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 57 | /* Secure invert test cases */ |
| 58 | /* Note: since this is sample code, only run if test services are enabled */ |
| 59 | {®ister_testsuite_s_invert_interface, 0, 0, 0}, |
Tamas Ban | c2074a7 | 2018-08-14 10:23:12 +0100 | [diff] [blame] | 60 | #endif /* TFM_PARTITION_TEST_CORE*/ |
Edison Ai | cf5e34c | 2018-06-19 18:06:54 +0800 | [diff] [blame] | 61 | |
| 62 | #ifdef CORE_TEST_IPC |
| 63 | /* Secure IPC test cases */ |
| 64 | {®ister_testsuite_s_ipc_interface, 0, 0, 0}, |
| 65 | #endif |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 66 | #endif /* SERVICES_TEST_S */ |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 67 | #endif /* TFM_LVL == 3 */ |
TTornblom | c640e07 | 2019-06-14 14:33:51 +0200 | [diff] [blame] | 68 | /* End of test suites */ |
| 69 | {0, 0, 0, 0} |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 70 | }; |
| 71 | |
| 72 | static void setup_integ_test(void) |
| 73 | { |
| 74 | /* Left empty intentionally, currently implemented |
| 75 | * test suites require no setup |
| 76 | */ |
| 77 | } |
| 78 | |
| 79 | static void tear_down_integ_test(void) |
| 80 | { |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame] | 81 | /* Left empty intentionally, currently implemented |
| 82 | * test suites require no tear down |
| 83 | */ |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | void start_integ_test(void) |
| 87 | { |
| 88 | setup_integ_test(); |
TTornblom | c640e07 | 2019-06-14 14:33:51 +0200 | [diff] [blame] | 89 | integ_test("Secure", test_suites); |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 90 | tear_down_integ_test(); |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 91 | } |