blob: 8fe0a94d930ebc0c6c8069a0374c91d8ad60cdd5 [file] [log] [blame]
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +00001/*
Jamie Foxb93da8b2018-12-13 18:27:30 +00002 * Copyright (c) 2017-2019, 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 Berengueffd3c462017-11-29 16:09:52 +000019static struct test_suite_t test_suites[] = {
Tamas Band90c81b2018-08-15 15:03:42 +010020#if TFM_LVL == 3
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000021#ifdef SERVICES_TEST_S
Tamas Band90c81b2018-08-15 15:03:42 +010022 /* List test cases which compliant with level 3 isolation */
Tamas Ban229f9db2018-08-17 12:57:13 +010023 /* Secure initial attestation service test cases */
24 {&register_testsuite_s_attestation_interface, 0, 0, 0},
Tamas Band90c81b2018-08-15 15:03:42 +010025#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 Foxb93da8b2018-12-13 18:27:30 +000031
Jamie Foxece411c2019-01-08 13:29:34 +000032#ifdef PSA_PROTECTED_STORAGE
33 {&register_testsuite_s_psa_ps_interface, 0, 0, 0},
34#else /* PSA_PROTECTED_STORAGE */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000035 /* Secure SST test cases */
36 {&register_testsuite_s_sst_sec_interface, 0, 0, 0},
37 {&register_testsuite_s_sst_reliability, 0, 0, 0},
38
Marc Moreno Berengue42e74b42018-08-15 14:28:45 +010039#if defined(SST_ROLLBACK_PROTECTION) && defined(SST_ENCRYPTION)
40 {&register_testsuite_s_rollback_protection, 0, 0, 0},
41#endif
Jamie Foxece411c2019-01-08 13:29:34 +000042#endif /* PSA_PROTECTED_STORAGE */
Marc Moreno Berengue42e74b42018-08-15 14:28:45 +010043
Antonio de Angelis2eeac642018-08-21 14:23:22 +010044 /* Secure Audit Logging test cases */
45 {&register_testsuite_s_audit_interface, 0, 0, 0},
Antonio de Angelis7852dff2018-02-07 11:15:54 +000046
Antonio de Angelis88c5b272018-08-31 15:48:21 +010047 /* Crypto test cases */
48 {&register_testsuite_s_crypto_interface, 0, 0, 0},
49
Tamas Ban229f9db2018-08-17 12:57:13 +010050 /* Secure initial attestation service test cases */
51 {&register_testsuite_s_attestation_interface, 0, 0, 0},
52
Mate Toth-Pal349714a2018-02-23 15:30:24 +010053#ifdef TFM_PARTITION_TEST_CORE
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000054 /* Secure invert test cases */
55 /* Note: since this is sample code, only run if test services are enabled */
56 {&register_testsuite_s_invert_interface, 0, 0, 0},
Tamas Banc2074a72018-08-14 10:23:12 +010057#endif /* TFM_PARTITION_TEST_CORE*/
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000058#endif /* SERVICES_TEST_S */
Tamas Band90c81b2018-08-15 15:03:42 +010059#endif /* TFM_LVL == 3 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000060};
61
62static void setup_integ_test(void)
63{
64 /* Left empty intentionally, currently implemented
65 * test suites require no setup
66 */
67}
68
69static void tear_down_integ_test(void)
70{
Jamie Foxb93da8b2018-12-13 18:27:30 +000071 /* Left empty intentionally, currently implemented
72 * test suites require no tear down
73 */
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000074}
75
76void start_integ_test(void)
77{
78 setup_integ_test();
79 integ_test("Secure",
80 test_suites,
81 sizeof(test_suites)/sizeof(test_suites[0]));
82 tear_down_integ_test();
Marc Moreno Berengueffd3c462017-11-29 16:09:52 +000083}