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