Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014, STMicroelectronics International N.V. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License Version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #ifndef XTEST_TEST_H |
| 15 | #define XTEST_TEST_H |
| 16 | #include <adbg.h> |
| 17 | #include <tee_client_api.h> |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 18 | |
| 19 | /*ADBG Cases declaration.*/ |
| 20 | ADBG_CASE_DECLARE(XTEST_TEE_1001); |
| 21 | ADBG_CASE_DECLARE(XTEST_TEE_1004); |
| 22 | ADBG_CASE_DECLARE(XTEST_TEE_1005); |
| 23 | ADBG_CASE_DECLARE(XTEST_TEE_1006); |
| 24 | ADBG_CASE_DECLARE(XTEST_TEE_1007); |
| 25 | ADBG_CASE_DECLARE(XTEST_TEE_1008); |
| 26 | ADBG_CASE_DECLARE(XTEST_TEE_1009); |
| 27 | ADBG_CASE_DECLARE(XTEST_TEE_1010); |
| 28 | ADBG_CASE_DECLARE(XTEST_TEE_1011); |
| 29 | ADBG_CASE_DECLARE(XTEST_TEE_1012); |
Jens Wiklander | ac27ec1 | 2015-07-15 15:23:14 +0200 | [diff] [blame] | 30 | ADBG_CASE_DECLARE(XTEST_TEE_1013); |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 31 | |
| 32 | ADBG_CASE_DECLARE(XTEST_TEE_2001); |
| 33 | ADBG_CASE_DECLARE(XTEST_TEE_2002); |
| 34 | |
| 35 | ADBG_CASE_DECLARE(XTEST_TEE_4001); |
| 36 | ADBG_CASE_DECLARE(XTEST_TEE_4002); |
| 37 | ADBG_CASE_DECLARE(XTEST_TEE_4003_NO_XTS); |
| 38 | ADBG_CASE_DECLARE(XTEST_TEE_4003_XTS); |
| 39 | ADBG_CASE_DECLARE(XTEST_TEE_4004); |
| 40 | ADBG_CASE_DECLARE(XTEST_TEE_4005); |
| 41 | ADBG_CASE_DECLARE(XTEST_TEE_4006); |
| 42 | ADBG_CASE_DECLARE(XTEST_TEE_4007); |
| 43 | ADBG_CASE_DECLARE(XTEST_TEE_4008); |
Pascal Brand | 2b92b64 | 2015-07-16 13:29:42 +0200 | [diff] [blame] | 44 | ADBG_CASE_DECLARE(XTEST_TEE_4009); |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 45 | |
| 46 | ADBG_CASE_DECLARE(XTEST_TEE_5006); |
| 47 | |
| 48 | ADBG_CASE_DECLARE(XTEST_TEE_6001); |
| 49 | ADBG_CASE_DECLARE(XTEST_TEE_6002); |
| 50 | ADBG_CASE_DECLARE(XTEST_TEE_6003); |
| 51 | ADBG_CASE_DECLARE(XTEST_TEE_6004); |
| 52 | ADBG_CASE_DECLARE(XTEST_TEE_6005); |
| 53 | ADBG_CASE_DECLARE(XTEST_TEE_6006); |
| 54 | ADBG_CASE_DECLARE(XTEST_TEE_6007); |
| 55 | ADBG_CASE_DECLARE(XTEST_TEE_6008); |
| 56 | ADBG_CASE_DECLARE(XTEST_TEE_6009); |
Jerome Forissier | e368834 | 2015-09-24 10:45:17 -0700 | [diff] [blame] | 57 | #ifdef WITH_GP_TESTS |
Pascal Brand | 3084492 | 2015-09-17 12:12:42 +0200 | [diff] [blame] | 58 | ADBG_CASE_DECLARE(XTEST_TEE_6010); |
Pascal Brand | 8a74e36 | 2015-09-10 12:41:52 +0200 | [diff] [blame] | 59 | ADBG_CASE_DECLARE(XTEST_TEE_6011); |
| 60 | #endif |
Pascal Brand | eb84c44 | 2016-04-19 17:49:49 +0200 | [diff] [blame] | 61 | ADBG_CASE_DECLARE(XTEST_TEE_6012); |
Pascal Brand | 90f2335 | 2016-05-19 15:15:47 +0200 | [diff] [blame^] | 62 | ADBG_CASE_DECLARE(XTEST_TEE_6013); |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 63 | ADBG_CASE_DECLARE(XTEST_TEE_7001); |
| 64 | ADBG_CASE_DECLARE(XTEST_TEE_7002); |
| 65 | ADBG_CASE_DECLARE(XTEST_TEE_7003); |
| 66 | ADBG_CASE_DECLARE(XTEST_TEE_7004); |
| 67 | ADBG_CASE_DECLARE(XTEST_TEE_7005); |
| 68 | ADBG_CASE_DECLARE(XTEST_TEE_7006); |
| 69 | ADBG_CASE_DECLARE(XTEST_TEE_7007); |
| 70 | ADBG_CASE_DECLARE(XTEST_TEE_7008); |
| 71 | ADBG_CASE_DECLARE(XTEST_TEE_7009); |
| 72 | ADBG_CASE_DECLARE(XTEST_TEE_7010); |
| 73 | ADBG_CASE_DECLARE(XTEST_TEE_7013); |
| 74 | ADBG_CASE_DECLARE(XTEST_TEE_7016); |
| 75 | ADBG_CASE_DECLARE(XTEST_TEE_7017); |
| 76 | ADBG_CASE_DECLARE(XTEST_TEE_7018); |
| 77 | ADBG_CASE_DECLARE(XTEST_TEE_7019); |
| 78 | |
| 79 | ADBG_CASE_DECLARE(XTEST_TEE_10001); |
| 80 | ADBG_CASE_DECLARE(XTEST_TEE_10002); |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 81 | |
Jerome Forissier | e288175 | 2016-05-18 11:36:38 +0200 | [diff] [blame] | 82 | #if defined(CFG_ENC_FS) && defined(CFG_REE_FS) |
Cedric Chaumont | 1390f3a | 2015-08-31 13:55:16 +0200 | [diff] [blame] | 83 | ADBG_CASE_DECLARE(XTEST_TEE_20001); |
| 84 | ADBG_CASE_DECLARE(XTEST_TEE_20002); |
| 85 | ADBG_CASE_DECLARE(XTEST_TEE_20003); |
| 86 | ADBG_CASE_DECLARE(XTEST_TEE_20004); |
| 87 | ADBG_CASE_DECLARE(XTEST_TEE_20021); |
| 88 | ADBG_CASE_DECLARE(XTEST_TEE_20022); |
| 89 | ADBG_CASE_DECLARE(XTEST_TEE_20023); |
| 90 | |
| 91 | ADBG_CASE_DECLARE(XTEST_TEE_20501); |
| 92 | ADBG_CASE_DECLARE(XTEST_TEE_20502); |
| 93 | ADBG_CASE_DECLARE(XTEST_TEE_20503); |
| 94 | ADBG_CASE_DECLARE(XTEST_TEE_20521); |
| 95 | ADBG_CASE_DECLARE(XTEST_TEE_20522); |
| 96 | ADBG_CASE_DECLARE(XTEST_TEE_20523); |
Jerome Forissier | 6ef2e97 | 2016-01-22 17:51:13 +0100 | [diff] [blame] | 97 | #endif /* defined(CFG_ENC_FS) && !defined(CFG_ENC_FS) */ |
Cedric Chaumont | 1390f3a | 2015-08-31 13:55:16 +0200 | [diff] [blame] | 98 | |
James Kung | df1e6cf | 2015-09-14 22:42:24 +0800 | [diff] [blame] | 99 | ADBG_CASE_DECLARE(XTEST_TEE_BENCHMARK_1001); |
| 100 | ADBG_CASE_DECLARE(XTEST_TEE_BENCHMARK_1002); |
| 101 | ADBG_CASE_DECLARE(XTEST_TEE_BENCHMARK_1003); |
| 102 | |
Jerome Forissier | e368834 | 2015-09-24 10:45:17 -0700 | [diff] [blame] | 103 | #ifdef WITH_GP_TESTS |
Pascal Brand | 8a74e36 | 2015-09-10 12:41:52 +0200 | [diff] [blame] | 104 | #include "adbg_case_declare.h" |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 105 | ADBG_CASE_DECLARE_AUTO_GENERATED_TESTS() |
Pascal Brand | 8a74e36 | 2015-09-10 12:41:52 +0200 | [diff] [blame] | 106 | #endif |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 107 | |
| 108 | /* TEEC_Result */ |
| 109 | ADBG_ENUM_TABLE_DECLARE(TEEC_Result); |
| 110 | |
| 111 | #define ADBG_EXPECT_TEEC_RESULT(c, exp, got) \ |
| 112 | ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_TEEC_Result) |
| 113 | |
| 114 | #define ADBG_EXPECT_TEEC_SUCCESS(c, got) \ |
| 115 | ADBG_EXPECT_ENUM(c, TEEC_SUCCESS, got, ADBG_EnumTable_TEEC_Result) |
| 116 | |
| 117 | /* TEEC_ErrorOrigin */ |
| 118 | ADBG_ENUM_TABLE_DECLARE(TEEC_ErrorOrigin); |
| 119 | |
| 120 | #define ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, exp, got) \ |
| 121 | ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_TEEC_ErrorOrigin) |
| 122 | |
| 123 | /* bass_return_code */ |
| 124 | ADBG_ENUM_TABLE_DECLARE(bass_return_code); |
| 125 | |
| 126 | #define ADBG_EXPECT_BASS_RETURN_CODE(c, exp, got) \ |
| 127 | ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_bass_return_code) |
| 128 | |
| 129 | #define ADBG_EXPECT_BASS_RC_SUCCESS(c, got) \ |
| 130 | ADBG_EXPECT_ENUM(c, BASS_RC_SUCCESS, got, \ |
| 131 | ADBG_EnumTable_bass_return_code) |
| 132 | |
| 133 | |
| 134 | extern const char crypt_user_ta[]; |
| 135 | extern const unsigned int crypt_user_ta_size; |
| 136 | |
| 137 | extern const char os_test_ta[]; |
| 138 | extern const unsigned int os_test_ta_size; |
| 139 | |
| 140 | extern const char create_fail_test_ta[]; |
| 141 | extern const unsigned int create_fail_test_ta_size; |
| 142 | |
| 143 | extern const char rpc_test_ta[]; |
| 144 | extern const unsigned int rpc_test_ta_size; |
| 145 | |
| 146 | extern const char sims_test_ta[]; |
| 147 | extern const unsigned int sims_test_ta_size; |
| 148 | |
| 149 | extern const char gp_tta_testing_client_api_ta[]; |
| 150 | extern const unsigned int gp_tta_testing_client_api_ta_size; |
| 151 | |
| 152 | extern const char gp_tta_answer_success_to_open_session_invoke_ta[]; |
| 153 | extern const unsigned int gp_tta_answer_success_to_open_session_invoke_ta_size; |
| 154 | |
| 155 | extern const char gp_tta_answer_error_to_invoke_ta[]; |
| 156 | extern const unsigned int gp_tta_answer_error_to_invoke_ta_size; |
| 157 | |
| 158 | extern const char gp_tta_answer_error_to_open_session_ta[]; |
| 159 | extern const unsigned int gp_tta_answer_error_to_open_session_ta_size; |
| 160 | |
| 161 | extern const char gp_tta_check_open_session_with_4_parameters_ta[]; |
| 162 | extern const unsigned int gp_tta_check_open_session_with_4_parameters_ta_size; |
| 163 | |
| 164 | extern const char gp_tta_ds_ta[]; |
| 165 | extern const unsigned int gp_tta_ds_ta_size; |
| 166 | |
| 167 | extern const char storage_ta[]; |
| 168 | extern const unsigned int storage_ta_size; |
| 169 | |
| 170 | extern const char gp_tta_time_ta[]; |
| 171 | extern const unsigned int gp_tta_time_ta_size; |
| 172 | |
| 173 | extern const char gp_tta_tcf_ta[]; |
| 174 | extern const unsigned int gp_tta_tcf_ta_size; |
| 175 | |
| 176 | extern const char gp_tta_crypto_ta[]; |
| 177 | extern const unsigned int gp_tta_crypto_ta_size; |
| 178 | |
| 179 | extern const char gp_tta_arithm_ta[]; |
| 180 | extern const unsigned int gp_tta_arithm_ta_size; |
| 181 | |
| 182 | extern const char gp_tta_ica_ta[]; |
| 183 | extern const unsigned int gp_tta_ica_ta_size; |
| 184 | |
| 185 | extern const char gp_tta_ica2_ta[]; |
| 186 | extern const unsigned int gp_tta_ica2_ta_size; |
| 187 | |
| 188 | extern const char gp_tta_tcf_singleinstance_ta[]; |
| 189 | extern const unsigned int gp_tta_tcf_singleinstance_ta_size; |
| 190 | |
| 191 | extern const char gp_tta_tcf_multipleinstance_ta[]; |
| 192 | extern const unsigned int gp_tta_tcf_multipleinstance_ta_size; |
| 193 | |
| 194 | extern const TEEC_UUID crypt_user_ta_uuid; |
| 195 | extern const TEEC_UUID os_test_ta_uuid; |
| 196 | extern const TEEC_UUID create_fail_test_ta_uuid; |
| 197 | extern const TEEC_UUID rpc_test_ta_uuid; |
| 198 | extern const TEEC_UUID sims_test_ta_uuid; |
| 199 | extern const TEEC_UUID gp_tta_testing_client_api_uuid; |
| 200 | extern const TEEC_UUID gp_tta_answer_success_to_open_session_invoke_uuid; |
| 201 | extern const TEEC_UUID gp_tta_answer_error_to_invoke_uuid; |
| 202 | extern const TEEC_UUID gp_tta_answer_error_to_open_session_uuid; |
| 203 | extern const TEEC_UUID gp_tta_check_OpenSession_with_4_parameters_uuid; |
| 204 | extern const TEEC_UUID gp_tta_ds_uuid; |
| 205 | extern const TEEC_UUID storage_ta_uuid; |
| 206 | extern const TEEC_UUID enc_fs_key_manager_test_ta_uuid; |
| 207 | extern const TEEC_UUID ecc_test_ta_uuid; |
Jens Wiklander | cf16e84 | 2016-02-10 09:07:09 +0100 | [diff] [blame] | 208 | extern const TEEC_UUID sta_test_ta_uuid; |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 209 | extern const TEEC_UUID gp_tta_time_uuid; |
Jens Wiklander | ac27ec1 | 2015-07-15 15:23:14 +0200 | [diff] [blame] | 210 | extern const TEEC_UUID concurrent_ta_uuid; |
Jens Wiklander | 7067297 | 2016-04-06 00:01:45 +0200 | [diff] [blame] | 211 | extern const TEEC_UUID concurrent_large_ta_uuid; |
James Kung | df1e6cf | 2015-09-14 22:42:24 +0800 | [diff] [blame] | 212 | extern const TEEC_UUID storage_benchmark_ta_uuid; |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 213 | extern char *_device; |
| 214 | |
| 215 | #endif /*XTEST_TEST_H*/ |