Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 1 | /* |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, 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" |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 15 | #include "test/suites/invert/secure/invert_s_tests.h" |
Antonio de Angelis | 88c5b27 | 2018-08-31 15:48:21 +0100 | [diff] [blame] | 16 | #include "test/suites/crypto/secure/crypto_s_tests.h" |
| 17 | |
Marc Moreno Berengue | ace460a | 2018-05-03 12:57:11 +0100 | [diff] [blame] | 18 | #include "secure_fw/services/secure_storage/sst_object_system.h" |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 19 | |
| 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 |
| 29 | /* List test cases which compliant with level 1 isolation */ |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 30 | /* Secure SST test cases */ |
| 31 | {®ister_testsuite_s_sst_sec_interface, 0, 0, 0}, |
| 32 | {®ister_testsuite_s_sst_reliability, 0, 0, 0}, |
| 33 | |
Marc Moreno Berengue | 42e74b4 | 2018-08-15 14:28:45 +0100 | [diff] [blame] | 34 | #if defined(SST_ROLLBACK_PROTECTION) && defined(SST_ENCRYPTION) |
| 35 | {®ister_testsuite_s_rollback_protection, 0, 0, 0}, |
| 36 | #endif |
| 37 | |
Antonio de Angelis | 2eeac64 | 2018-08-21 14:23:22 +0100 | [diff] [blame] | 38 | /* Secure Audit Logging test cases */ |
| 39 | {®ister_testsuite_s_audit_interface, 0, 0, 0}, |
Antonio de Angelis | 7852dff | 2018-02-07 11:15:54 +0000 | [diff] [blame] | 40 | |
Antonio de Angelis | 88c5b27 | 2018-08-31 15:48:21 +0100 | [diff] [blame] | 41 | /* Crypto test cases */ |
| 42 | {®ister_testsuite_s_crypto_interface, 0, 0, 0}, |
| 43 | |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 44 | #ifdef TFM_PARTITION_TEST_CORE |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 45 | /* Secure invert test cases */ |
| 46 | /* Note: since this is sample code, only run if test services are enabled */ |
| 47 | {®ister_testsuite_s_invert_interface, 0, 0, 0}, |
Tamas Ban | c2074a7 | 2018-08-14 10:23:12 +0100 | [diff] [blame] | 48 | #endif /* TFM_PARTITION_TEST_CORE*/ |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 49 | #endif /* SERVICES_TEST_S */ |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 50 | #endif /* TFM_LVL == 3 */ |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | static void setup_integ_test(void) |
| 54 | { |
| 55 | /* Left empty intentionally, currently implemented |
| 56 | * test suites require no setup |
| 57 | */ |
| 58 | } |
| 59 | |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 60 | #if TFM_LVL == 1 |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 61 | static void tear_down_integ_test(void) |
| 62 | { |
| 63 | /* Leave the SST area clean after execute the tests */ |
Marc Moreno Berengue | ace460a | 2018-05-03 12:57:11 +0100 | [diff] [blame] | 64 | sst_system_wipe_all(); |
| 65 | sst_system_prepare(); |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 66 | } |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 67 | #endif /* TFM_LVL == 1 */ |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 68 | |
| 69 | void start_integ_test(void) |
| 70 | { |
| 71 | setup_integ_test(); |
| 72 | integ_test("Secure", |
| 73 | test_suites, |
| 74 | sizeof(test_suites)/sizeof(test_suites[0])); |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 75 | #if TFM_LVL == 1 |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 76 | tear_down_integ_test(); |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 77 | #endif /* TFM_LVL == 1 */ |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 78 | } |