1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (c) 2016, Linaro Limited
4  * Copyright (c) 2014, STMicroelectronics International N.V.
5  */
6 
7 #ifndef XTEST_TEST_H
8 #define XTEST_TEST_H
9 #include <adbg.h>
10 #include <tee_client_api.h>
11 
12 #ifdef CFG_PKCS11_TA
13 #include <pkcs11.h>
14 #endif
15 
16 ADBG_SUITE_DECLARE(benchmark);
17 #ifdef WITH_GP_TESTS
18 ADBG_SUITE_DECLARE(gp);
19 #endif
20 #ifdef CFG_PKCS11_TA
21 ADBG_SUITE_DECLARE(pkcs11);
22 #endif
23 #ifdef CFG_SPMC_TESTS
24 ADBG_SUITE_DECLARE(ffa_spmc);
25 #endif
26 ADBG_SUITE_DECLARE(regression);
27 
28 /* TEEC_Result */
29 ADBG_ENUM_TABLE_DECLARE(TEEC_Result);
30 
31 #define ADBG_EXPECT_TEEC_RESULT(c, exp, got) \
32 	ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_TEEC_Result)
33 
34 #define ADBG_EXPECT_TEEC_SUCCESS(c, got) \
35 	ADBG_EXPECT_ENUM(c, TEEC_SUCCESS, got, ADBG_EnumTable_TEEC_Result)
36 
37 /* TEEC_ErrorOrigin */
38 ADBG_ENUM_TABLE_DECLARE(TEEC_ErrorOrigin);
39 
40 #define ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, exp, got) \
41 	ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_TEEC_ErrorOrigin)
42 
43 #ifdef CFG_PKCS11_TA
44 /* CK_RV */
45 ADBG_ENUM_TABLE_DECLARE(CK_RV);
46 
47 #define ADBG_EXPECT_CK_RESULT(c, exp, got) \
48 	ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_CK_RV)
49 
50 #define ADBG_EXPECT_CK_OK(c, got) \
51 	ADBG_EXPECT_ENUM(c, CKR_OK, got, ADBG_EnumTable_CK_RV)
52 #endif
53 
54 extern const char crypt_user_ta[];
55 extern const unsigned int crypt_user_ta_size;
56 
57 extern const char os_test_ta[];
58 extern const unsigned int os_test_ta_size;
59 
60 extern const char create_fail_test_ta[];
61 extern const unsigned int create_fail_test_ta_size;
62 
63 extern const char rpc_test_ta[];
64 extern const unsigned int rpc_test_ta_size;
65 
66 extern const char sims_test_ta[];
67 extern const unsigned int sims_test_ta_size;
68 
69 extern const char gp_tta_testing_client_api_ta[];
70 extern const unsigned int gp_tta_testing_client_api_ta_size;
71 
72 extern const char gp_tta_answer_success_to_open_session_invoke_ta[];
73 extern const unsigned int gp_tta_answer_success_to_open_session_invoke_ta_size;
74 
75 extern const char gp_tta_answer_error_to_invoke_ta[];
76 extern const unsigned int gp_tta_answer_error_to_invoke_ta_size;
77 
78 extern const char gp_tta_answer_error_to_open_session_ta[];
79 extern const unsigned int gp_tta_answer_error_to_open_session_ta_size;
80 
81 extern const char gp_tta_check_open_session_with_4_parameters_ta[];
82 extern const unsigned int gp_tta_check_open_session_with_4_parameters_ta_size;
83 
84 extern const char gp_tta_ds_ta[];
85 extern const unsigned int gp_tta_ds_ta_size;
86 
87 extern const char storage_ta[];
88 extern const unsigned int storage_ta_size;
89 
90 extern const char gp_tta_time_ta[];
91 extern const unsigned int gp_tta_time_ta_size;
92 
93 extern const char gp_tta_tcf_ta[];
94 extern const unsigned int gp_tta_tcf_ta_size;
95 
96 extern const char gp_tta_crypto_ta[];
97 extern const unsigned int gp_tta_crypto_ta_size;
98 
99 extern const char gp_tta_arithm_ta[];
100 extern const unsigned int gp_tta_arithm_ta_size;
101 
102 extern const char gp_tta_ica_ta[];
103 extern const unsigned int gp_tta_ica_ta_size;
104 
105 extern const char gp_tta_ica2_ta[];
106 extern const unsigned int gp_tta_ica2_ta_size;
107 
108 extern const char gp_tta_tcf_singleinstance_ta[];
109 extern const unsigned int gp_tta_tcf_singleinstance_ta_size;
110 
111 extern const char gp_tta_tcf_multipleinstance_ta[];
112 extern const unsigned int gp_tta_tcf_multipleinstance_ta_size;
113 
114 extern const TEEC_UUID crypt_user_ta_uuid;
115 extern const TEEC_UUID os_test_ta_uuid;
116 extern const TEEC_UUID create_fail_test_ta_uuid;
117 extern const TEEC_UUID rpc_test_ta_uuid;
118 extern const TEEC_UUID sims_test_ta_uuid;
119 extern const TEEC_UUID miss_test_ta_uuid;
120 extern const TEEC_UUID sims_keepalive_test_ta_uuid;
121 extern const TEEC_UUID gp_tta_testing_client_api_uuid;
122 extern const TEEC_UUID gp_tta_answer_success_to_open_session_invoke_uuid;
123 extern const TEEC_UUID gp_tta_answer_error_to_invoke_uuid;
124 extern const TEEC_UUID gp_tta_answer_error_to_open_session_uuid;
125 extern const TEEC_UUID gp_tta_check_OpenSession_with_4_parameters_uuid;
126 extern const TEEC_UUID gp_tta_ds_uuid;
127 extern const TEEC_UUID storage_ta_uuid;
128 extern const TEEC_UUID storage2_ta_uuid;
129 extern const TEEC_UUID enc_fs_key_manager_test_ta_uuid;
130 extern const TEEC_UUID ecc_test_ta_uuid;
131 extern const TEEC_UUID pta_invoke_tests_ta_uuid;
132 extern const TEEC_UUID gp_tta_time_uuid;
133 extern const TEEC_UUID concurrent_ta_uuid;
134 extern const TEEC_UUID concurrent_large_ta_uuid;
135 extern const TEEC_UUID storage_benchmark_ta_uuid;
136 extern const TEEC_UUID socket_ta_uuid;
137 extern const TEEC_UUID sdp_basic_ta_uuid;
138 extern const TEEC_UUID tpm_log_test_ta_uuid;
139 extern const TEEC_UUID supp_plugin_test_ta_uuid;
140 extern const TEEC_UUID large_ta_uuid;
141 extern const TEEC_UUID bti_test_ta_uuid;
142 extern const TEEC_UUID subkey1_ta_uuid;
143 extern const TEEC_UUID subkey2_ta_uuid;
144 extern char *xtest_tee_name;
145 
146 #endif /*XTEST_TEST_H*/
147