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