blob: 3ed95dda93624a3153cc947bc5dce5e2ea7cf0ed [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"
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000015#include "test/suites/invert/secure/invert_s_tests.h"
Marc Moreno Berengueace460a2018-05-03 12:57:11 +010016#include "secure_fw/services/secure_storage/sst_object_system.h"
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000017
18static struct test_suite_t test_suites[] = {
Tamas Band90c81b2018-08-15 15:03:42 +010019#if TFM_LVL == 3
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000020#ifdef SERVICES_TEST_S
Tamas Band90c81b2018-08-15 15:03:42 +010021 /* 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 Berengueffd3c462017-11-29 16:09:52 +000028 /* Secure SST test cases */
29 {&register_testsuite_s_sst_sec_interface, 0, 0, 0},
30 {&register_testsuite_s_sst_reliability, 0, 0, 0},
31
Antonio de Angelis2eeac642018-08-21 14:23:22 +010032 /* Secure Audit Logging test cases */
33 {&register_testsuite_s_audit_interface, 0, 0, 0},
Antonio de Angelis7852dff2018-02-07 11:15:54 +000034
Mate Toth-Pal349714a2018-02-23 15:30:24 +010035#ifdef TFM_PARTITION_TEST_CORE
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000036 /* Secure invert test cases */
37 /* Note: since this is sample code, only run if test services are enabled */
38 {&register_testsuite_s_invert_interface, 0, 0, 0},
Tamas Banc2074a72018-08-14 10:23:12 +010039#endif /* TFM_PARTITION_TEST_CORE*/
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000040#endif /* SERVICES_TEST_S */
Tamas Band90c81b2018-08-15 15:03:42 +010041#endif /* TFM_LVL == 3 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000042};
43
44static void setup_integ_test(void)
45{
46 /* Left empty intentionally, currently implemented
47 * test suites require no setup
48 */
49}
50
Tamas Band90c81b2018-08-15 15:03:42 +010051#if TFM_LVL == 1
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000052static void tear_down_integ_test(void)
53{
54 /* Leave the SST area clean after execute the tests */
Marc Moreno Berengueace460a2018-05-03 12:57:11 +010055 sst_system_wipe_all();
56 sst_system_prepare();
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000057}
Tamas Band90c81b2018-08-15 15:03:42 +010058#endif /* TFM_LVL == 1 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000059
60void 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 Band90c81b2018-08-15 15:03:42 +010066#if TFM_LVL == 1
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000067 tear_down_integ_test();
Tamas Band90c81b2018-08-15 15:03:42 +010068#endif /* TFM_LVL == 1 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000069}