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" |
| 18 | |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 19 | static struct test_suite_t test_suites[] = { |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 20 | #if TFM_LVL == 3 |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 21 | #ifdef SERVICES_TEST_S |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 22 | /* List test cases which compliant with level 3 isolation */ |
Tamas Ban | 229f9db | 2018-08-17 12:57:13 +0100 | [diff] [blame] | 23 | /* Secure initial attestation service test cases */ |
| 24 | {®ister_testsuite_s_attestation_interface, 0, 0, 0}, |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 25 | #endif /* SERVICES_TEST_S */ |
| 26 | |
| 27 | #else /* TFM_LVL == 3 */ |
| 28 | |
| 29 | #ifdef SERVICES_TEST_S |
| 30 | /* List test cases which compliant with level 1 isolation */ |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame] | 31 | |
| 32 | #ifndef PSA_PROTECTED_STORAGE |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 33 | /* Secure SST test cases */ |
| 34 | {®ister_testsuite_s_sst_sec_interface, 0, 0, 0}, |
| 35 | {®ister_testsuite_s_sst_reliability, 0, 0, 0}, |
| 36 | |
Marc Moreno Berengue | 42e74b4 | 2018-08-15 14:28:45 +0100 | [diff] [blame] | 37 | #if defined(SST_ROLLBACK_PROTECTION) && defined(SST_ENCRYPTION) |
| 38 | {®ister_testsuite_s_rollback_protection, 0, 0, 0}, |
| 39 | #endif |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame] | 40 | #endif /* !PSA_PROTECTED_STORAGE */ |
Marc Moreno Berengue | 42e74b4 | 2018-08-15 14:28:45 +0100 | [diff] [blame] | 41 | |
Antonio de Angelis | 2eeac64 | 2018-08-21 14:23:22 +0100 | [diff] [blame] | 42 | /* Secure Audit Logging test cases */ |
| 43 | {®ister_testsuite_s_audit_interface, 0, 0, 0}, |
Antonio de Angelis | 7852dff | 2018-02-07 11:15:54 +0000 | [diff] [blame] | 44 | |
Antonio de Angelis | 88c5b27 | 2018-08-31 15:48:21 +0100 | [diff] [blame] | 45 | /* Crypto test cases */ |
| 46 | {®ister_testsuite_s_crypto_interface, 0, 0, 0}, |
| 47 | |
Tamas Ban | 229f9db | 2018-08-17 12:57:13 +0100 | [diff] [blame] | 48 | /* Secure initial attestation service test cases */ |
| 49 | {®ister_testsuite_s_attestation_interface, 0, 0, 0}, |
| 50 | |
Mate Toth-Pal | 349714a | 2018-02-23 15:30:24 +0100 | [diff] [blame] | 51 | #ifdef TFM_PARTITION_TEST_CORE |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 52 | /* Secure invert test cases */ |
| 53 | /* Note: since this is sample code, only run if test services are enabled */ |
| 54 | {®ister_testsuite_s_invert_interface, 0, 0, 0}, |
Tamas Ban | c2074a7 | 2018-08-14 10:23:12 +0100 | [diff] [blame] | 55 | #endif /* TFM_PARTITION_TEST_CORE*/ |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 56 | #endif /* SERVICES_TEST_S */ |
Tamas Ban | d90c81b | 2018-08-15 15:03:42 +0100 | [diff] [blame] | 57 | #endif /* TFM_LVL == 3 */ |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | static void setup_integ_test(void) |
| 61 | { |
| 62 | /* Left empty intentionally, currently implemented |
| 63 | * test suites require no setup |
| 64 | */ |
| 65 | } |
| 66 | |
| 67 | static void tear_down_integ_test(void) |
| 68 | { |
Jamie Fox | b93da8b | 2018-12-13 18:27:30 +0000 | [diff] [blame] | 69 | /* Left empty intentionally, currently implemented |
| 70 | * test suites require no tear down |
| 71 | */ |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | void start_integ_test(void) |
| 75 | { |
| 76 | setup_integ_test(); |
| 77 | integ_test("Secure", |
| 78 | test_suites, |
| 79 | sizeof(test_suites)/sizeof(test_suites[0])); |
| 80 | tear_down_integ_test(); |
Marc Moreno Berengue | ffd3c46 | 2017-11-29 16:09:52 +0000 | [diff] [blame] | 81 | } |