blob: 83c9eebc8e36714d8cfa7c3b989f184f33949005 [file] [log] [blame]
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +00001/*
Mate Toth-Pal349714a2018-02-23 15:30:24 +01002 * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
Tamas Banc2074a72018-08-14 10:23:12 +01008#include "test_framework_integ_test.h"
9#include "test_framework_integ_test_helper.h"
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000010#include "test_framework.h"
11
12/* Service specific includes */
13#include "test/suites/sst/secure/sst_tests.h"
Antonio de Angelis2eeac642018-08-21 14:23:22 +010014#include "test/suites/audit/secure/audit_s_tests.h"
Tamas Ban229f9db2018-08-17 12:57:13 +010015#include "test/suites/attestation/secure/attestation_s_tests.h"
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000016#include "test/suites/invert/secure/invert_s_tests.h"
Antonio de Angelis88c5b272018-08-31 15:48:21 +010017#include "test/suites/crypto/secure/crypto_s_tests.h"
18
Marc Moreno Berengueace460a2018-05-03 12:57:11 +010019#include "secure_fw/services/secure_storage/sst_object_system.h"
Edison Aicf5e34c2018-06-19 18:06:54 +080020#include "test/suites/ipc/secure/ipc_s_tests.h"
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000021
22static struct test_suite_t test_suites[] = {
Tamas Band90c81b2018-08-15 15:03:42 +010023#if TFM_LVL == 3
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000024#ifdef SERVICES_TEST_S
Tamas Band90c81b2018-08-15 15:03:42 +010025 /* List test cases which compliant with level 3 isolation */
Tamas Ban229f9db2018-08-17 12:57:13 +010026 /* Secure initial attestation service test cases */
27 {&register_testsuite_s_attestation_interface, 0, 0, 0},
Tamas Band90c81b2018-08-15 15:03:42 +010028#endif /* SERVICES_TEST_S */
29
30#else /* TFM_LVL == 3 */
31
32#ifdef SERVICES_TEST_S
33 /* List test cases which compliant with level 1 isolation */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000034 /* Secure SST test cases */
35 {&register_testsuite_s_sst_sec_interface, 0, 0, 0},
36 {&register_testsuite_s_sst_reliability, 0, 0, 0},
37
Marc Moreno Berengue42e74b42018-08-15 14:28:45 +010038#if defined(SST_ROLLBACK_PROTECTION) && defined(SST_ENCRYPTION)
39 {&register_testsuite_s_rollback_protection, 0, 0, 0},
40#endif
41
Antonio de Angelis2eeac642018-08-21 14:23:22 +010042 /* Secure Audit Logging test cases */
43 {&register_testsuite_s_audit_interface, 0, 0, 0},
Antonio de Angelis7852dff2018-02-07 11:15:54 +000044
Antonio de Angelis88c5b272018-08-31 15:48:21 +010045 /* Crypto test cases */
46 {&register_testsuite_s_crypto_interface, 0, 0, 0},
47
Tamas Ban229f9db2018-08-17 12:57:13 +010048 /* Secure initial attestation service test cases */
49 {&register_testsuite_s_attestation_interface, 0, 0, 0},
50
Mate Toth-Pal349714a2018-02-23 15:30:24 +010051#ifdef TFM_PARTITION_TEST_CORE
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000052 /* Secure invert test cases */
53 /* Note: since this is sample code, only run if test services are enabled */
54 {&register_testsuite_s_invert_interface, 0, 0, 0},
Tamas Banc2074a72018-08-14 10:23:12 +010055#endif /* TFM_PARTITION_TEST_CORE*/
Edison Aicf5e34c2018-06-19 18:06:54 +080056
57#ifdef CORE_TEST_IPC
58 /* Secure IPC test cases */
59 {&register_testsuite_s_ipc_interface, 0, 0, 0},
60#endif
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000061#endif /* SERVICES_TEST_S */
Tamas Band90c81b2018-08-15 15:03:42 +010062#endif /* TFM_LVL == 3 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000063};
64
65static void setup_integ_test(void)
66{
67 /* Left empty intentionally, currently implemented
68 * test suites require no setup
69 */
70}
71
Tamas Band90c81b2018-08-15 15:03:42 +010072#if TFM_LVL == 1
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000073static void tear_down_integ_test(void)
74{
75 /* Leave the SST area clean after execute the tests */
Marc Moreno Berengueace460a2018-05-03 12:57:11 +010076 sst_system_wipe_all();
77 sst_system_prepare();
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000078}
Tamas Band90c81b2018-08-15 15:03:42 +010079#endif /* TFM_LVL == 1 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000080
81void start_integ_test(void)
82{
83 setup_integ_test();
84 integ_test("Secure",
85 test_suites,
86 sizeof(test_suites)/sizeof(test_suites[0]));
Tamas Band90c81b2018-08-15 15:03:42 +010087#if TFM_LVL == 1
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000088 tear_down_integ_test();
Tamas Band90c81b2018-08-15 15:03:42 +010089#endif /* TFM_LVL == 1 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000090}