blob: 1dde38de88593f5f1ab73aceda5e1fd43c40d430 [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"
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000020
21static struct test_suite_t test_suites[] = {
Tamas Band90c81b2018-08-15 15:03:42 +010022#if TFM_LVL == 3
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000023#ifdef SERVICES_TEST_S
Tamas Band90c81b2018-08-15 15:03:42 +010024 /* List test cases which compliant with level 3 isolation */
Tamas Ban229f9db2018-08-17 12:57:13 +010025 /* Secure initial attestation service test cases */
26 {&register_testsuite_s_attestation_interface, 0, 0, 0},
Tamas Band90c81b2018-08-15 15:03:42 +010027#endif /* SERVICES_TEST_S */
28
29#else /* TFM_LVL == 3 */
30
31#ifdef SERVICES_TEST_S
32 /* List test cases which compliant with level 1 isolation */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000033 /* Secure SST test cases */
34 {&register_testsuite_s_sst_sec_interface, 0, 0, 0},
35 {&register_testsuite_s_sst_reliability, 0, 0, 0},
36
Marc Moreno Berengue42e74b42018-08-15 14:28:45 +010037#if defined(SST_ROLLBACK_PROTECTION) && defined(SST_ENCRYPTION)
38 {&register_testsuite_s_rollback_protection, 0, 0, 0},
39#endif
40
Antonio de Angelis2eeac642018-08-21 14:23:22 +010041 /* Secure Audit Logging test cases */
42 {&register_testsuite_s_audit_interface, 0, 0, 0},
Antonio de Angelis7852dff2018-02-07 11:15:54 +000043
Antonio de Angelis88c5b272018-08-31 15:48:21 +010044 /* Crypto test cases */
45 {&register_testsuite_s_crypto_interface, 0, 0, 0},
46
Tamas Ban229f9db2018-08-17 12:57:13 +010047 /* Secure initial attestation service test cases */
48 {&register_testsuite_s_attestation_interface, 0, 0, 0},
49
Mate Toth-Pal349714a2018-02-23 15:30:24 +010050#ifdef TFM_PARTITION_TEST_CORE
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000051 /* Secure invert test cases */
52 /* Note: since this is sample code, only run if test services are enabled */
53 {&register_testsuite_s_invert_interface, 0, 0, 0},
Tamas Banc2074a72018-08-14 10:23:12 +010054#endif /* TFM_PARTITION_TEST_CORE*/
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000055#endif /* SERVICES_TEST_S */
Tamas Band90c81b2018-08-15 15:03:42 +010056#endif /* TFM_LVL == 3 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000057};
58
59static void setup_integ_test(void)
60{
61 /* Left empty intentionally, currently implemented
62 * test suites require no setup
63 */
64}
65
Tamas Band90c81b2018-08-15 15:03:42 +010066#if TFM_LVL == 1
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000067static void tear_down_integ_test(void)
68{
69 /* Leave the SST area clean after execute the tests */
Marc Moreno Berengueace460a2018-05-03 12:57:11 +010070 sst_system_wipe_all();
71 sst_system_prepare();
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000072}
Tamas Band90c81b2018-08-15 15:03:42 +010073#endif /* TFM_LVL == 1 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000074
75void start_integ_test(void)
76{
77 setup_integ_test();
78 integ_test("Secure",
79 test_suites,
80 sizeof(test_suites)/sizeof(test_suites[0]));
Tamas Band90c81b2018-08-15 15:03:42 +010081#if TFM_LVL == 1
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000082 tear_down_integ_test();
Tamas Band90c81b2018-08-15 15:03:42 +010083#endif /* TFM_LVL == 1 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000084}