Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 1 | /* |
Summer Qin | f54e729 | 2022-10-13 15:29:28 +0800 | [diff] [blame^] | 2 | * Copyright (c) 2017-2022, Arm Limited. All rights reserved. |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #include "test_framework_integ_test.h" |
| 9 | #include "test_framework_integ_test_helper.h" |
| 10 | #include "test_framework.h" |
| 11 | |
| 12 | /* Service specific includes */ |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 13 | #ifdef TEST_S_PS |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 14 | #include "ps_tests.h" |
| 15 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 16 | #ifdef TEST_S_ITS |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 17 | #include "its_s_tests.h" |
| 18 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 19 | #ifdef TEST_S_ATTESTATION |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 20 | #include "attest_s_tests.h" |
| 21 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 22 | #ifdef TEST_S_CRYPTO |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 23 | #include "crypto_s_tests.h" |
| 24 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 25 | #ifdef TEST_S_FWU |
Sherry Zhang | 92c499a | 2021-03-08 18:14:15 +0800 | [diff] [blame] | 26 | #include "fwu_s_tests.h" |
| 27 | #endif |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 28 | #ifdef TEST_S_PLATFORM |
Raef Coles | 652bb8a | 2020-09-24 11:27:38 +0100 | [diff] [blame] | 29 | #include "platform_s_tests.h" |
| 30 | #endif |
Kevin Peng | e85c6a8 | 2022-03-03 17:12:27 +0800 | [diff] [blame] | 31 | #ifdef TEST_S_IPC |
| 32 | #include "ipc_s_tests.h" |
| 33 | #endif |
| 34 | #ifdef TEST_S_SFN_BACKEND |
| 35 | #include "sfn_s_tests.h" |
| 36 | #endif |
Feder Liang | db53c6b | 2021-09-07 15:42:09 +0800 | [diff] [blame] | 37 | #if defined (TEST_S_FPU) |
| 38 | #include "fpu_s_tests.h" |
| 39 | #endif |
Jianliang Shen | 2959c1f | 2021-09-01 10:14:06 +0800 | [diff] [blame] | 40 | #ifdef EXTRA_S_TEST_SUITE |
| 41 | #include "extra_s_tests.h" |
| 42 | #endif |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 43 | |
| 44 | static struct test_suite_t test_suites[] = { |
Kevin Peng | 018f718 | 2022-03-07 14:11:20 +0800 | [diff] [blame] | 45 | #ifdef TEST_S_IPC |
| 46 | /* Secure IPC test cases */ |
| 47 | {®ister_testsuite_s_ipc_interface, 0, 0, 0}, |
| 48 | #endif |
| 49 | |
| 50 | #ifdef TEST_S_SFN_BACKEND |
| 51 | /* Secure SFN backend test cases */ |
| 52 | {®ister_testsuite_s_sfn_interface, 0, 0, 0}, |
| 53 | #endif |
| 54 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 55 | #ifdef TEST_S_PS |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 56 | {®ister_testsuite_s_psa_ps_interface, 0, 0, 0}, |
| 57 | {®ister_testsuite_s_psa_ps_reliability, 0, 0, 0}, |
| 58 | |
| 59 | #ifdef PS_TEST_NV_COUNTERS |
| 60 | {®ister_testsuite_s_rollback_protection, 0, 0, 0}, |
| 61 | #endif |
| 62 | #endif |
| 63 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 64 | #ifdef TEST_S_ITS |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 65 | /* Secure ITS test cases */ |
| 66 | {®ister_testsuite_s_psa_its_interface, 0, 0, 0}, |
| 67 | {®ister_testsuite_s_psa_its_reliability, 0, 0, 0}, |
| 68 | #endif |
| 69 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 70 | #ifdef TEST_S_CRYPTO |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 71 | /* Crypto test cases */ |
| 72 | {®ister_testsuite_s_crypto_interface, 0, 0, 0}, |
| 73 | #endif |
| 74 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 75 | #ifdef TEST_S_ATTESTATION |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 76 | /* Secure initial attestation service test cases */ |
| 77 | {®ister_testsuite_s_attestation_interface, 0, 0, 0}, |
| 78 | #endif |
| 79 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 80 | #ifdef TEST_S_PLATFORM |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 81 | /* Secure platform service test cases */ |
| 82 | {®ister_testsuite_s_platform_interface, 0, 0, 0}, |
| 83 | #endif |
| 84 | |
shejia01 | e0dd80a | 2021-07-12 17:47:50 +0800 | [diff] [blame] | 85 | #ifdef TEST_S_FWU |
Sherry Zhang | a59fecd | 2021-05-24 16:37:36 +0800 | [diff] [blame] | 86 | /* Secure Firmware Update test cases */ |
Sherry Zhang | 92c499a | 2021-03-08 18:14:15 +0800 | [diff] [blame] | 87 | {®ister_testsuite_s_psa_fwu_interface, 0, 0, 0}, |
| 88 | #endif |
| 89 | |
Feder Liang | db53c6b | 2021-09-07 15:42:09 +0800 | [diff] [blame] | 90 | #ifdef TEST_S_FPU |
| 91 | /* Secure FPU test cases */ |
| 92 | {®ister_testsuite_s_fpu_interface, 0, 0, 0}, |
| 93 | #endif |
| 94 | |
Jianliang Shen | 2959c1f | 2021-09-01 10:14:06 +0800 | [diff] [blame] | 95 | #ifdef EXTRA_S_TEST_SUITE |
| 96 | /* Secure extra test cases */ |
| 97 | {®ister_testsuite_extra_s_interface, 0, 0, 0}, |
| 98 | #endif |
| 99 | |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 100 | /* End of test suites */ |
| 101 | {0, 0, 0, 0} |
| 102 | }; |
| 103 | |
| 104 | static void setup_integ_test(void) |
| 105 | { |
| 106 | /* Left empty intentionally, currently implemented |
| 107 | * test suites require no setup |
| 108 | */ |
| 109 | } |
| 110 | |
| 111 | static void tear_down_integ_test(void) |
| 112 | { |
| 113 | /* Left empty intentionally, currently implemented |
| 114 | * test suites require no tear down |
| 115 | */ |
| 116 | } |
| 117 | |
| 118 | enum test_suite_err_t start_integ_test(void) |
| 119 | { |
| 120 | enum test_suite_err_t retval; |
| 121 | |
| 122 | setup_integ_test(); |
| 123 | retval = integ_test("Secure", test_suites); |
| 124 | tear_down_integ_test(); |
| 125 | return retval; |
| 126 | } |