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 ADBG_SUITE_DECLARE(regression);
24 
25 /* TEEC_Result */
26 ADBG_ENUM_TABLE_DECLARE(TEEC_Result);
27 
28 #define ADBG_EXPECT_TEEC_RESULT(c, exp, got) \
29 	ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_TEEC_Result)
30 
31 #define ADBG_EXPECT_TEEC_SUCCESS(c, got) \
32 	ADBG_EXPECT_ENUM(c, TEEC_SUCCESS, got, ADBG_EnumTable_TEEC_Result)
33 
34 /* TEEC_ErrorOrigin */
35 ADBG_ENUM_TABLE_DECLARE(TEEC_ErrorOrigin);
36 
37 #define ADBG_EXPECT_TEEC_ERROR_ORIGIN(c, exp, got) \
38 	ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_TEEC_ErrorOrigin)
39 
40 #ifdef CFG_PKCS11_TA
41 /* CK_RV */
42 ADBG_ENUM_TABLE_DECLARE(CK_RV);
43 
44 #define ADBG_EXPECT_CK_RESULT(c, exp, got) \
45 	ADBG_EXPECT_ENUM(c, exp, got, ADBG_EnumTable_CK_RV)
46 
47 #define ADBG_EXPECT_CK_OK(c, got) \
48 	ADBG_EXPECT_ENUM(c, CKR_OK, got, ADBG_EnumTable_CK_RV)
49 #endif
50 
51 extern const char crypt_user_ta[];
52 extern const unsigned int crypt_user_ta_size;
53 
54 extern const char os_test_ta[];
55 extern const unsigned int os_test_ta_size;
56 
57 extern const char create_fail_test_ta[];
58 extern const unsigned int create_fail_test_ta_size;
59 
60 extern const char rpc_test_ta[];
61 extern const unsigned int rpc_test_ta_size;
62 
63 extern const char sims_test_ta[];
64 extern const unsigned int sims_test_ta_size;
65 
66 extern const char gp_tta_testing_client_api_ta[];
67 extern const unsigned int gp_tta_testing_client_api_ta_size;
68 
69 extern const char gp_tta_answer_success_to_open_session_invoke_ta[];
70 extern const unsigned int gp_tta_answer_success_to_open_session_invoke_ta_size;
71 
72 extern const char gp_tta_answer_error_to_invoke_ta[];
73 extern const unsigned int gp_tta_answer_error_to_invoke_ta_size;
74 
75 extern const char gp_tta_answer_error_to_open_session_ta[];
76 extern const unsigned int gp_tta_answer_error_to_open_session_ta_size;
77 
78 extern const char gp_tta_check_open_session_with_4_parameters_ta[];
79 extern const unsigned int gp_tta_check_open_session_with_4_parameters_ta_size;
80 
81 extern const char gp_tta_ds_ta[];
82 extern const unsigned int gp_tta_ds_ta_size;
83 
84 extern const char storage_ta[];
85 extern const unsigned int storage_ta_size;
86 
87 extern const char gp_tta_time_ta[];
88 extern const unsigned int gp_tta_time_ta_size;
89 
90 extern const char gp_tta_tcf_ta[];
91 extern const unsigned int gp_tta_tcf_ta_size;
92 
93 extern const char gp_tta_crypto_ta[];
94 extern const unsigned int gp_tta_crypto_ta_size;
95 
96 extern const char gp_tta_arithm_ta[];
97 extern const unsigned int gp_tta_arithm_ta_size;
98 
99 extern const char gp_tta_ica_ta[];
100 extern const unsigned int gp_tta_ica_ta_size;
101 
102 extern const char gp_tta_ica2_ta[];
103 extern const unsigned int gp_tta_ica2_ta_size;
104 
105 extern const char gp_tta_tcf_singleinstance_ta[];
106 extern const unsigned int gp_tta_tcf_singleinstance_ta_size;
107 
108 extern const char gp_tta_tcf_multipleinstance_ta[];
109 extern const unsigned int gp_tta_tcf_multipleinstance_ta_size;
110 
111 extern const TEEC_UUID crypt_user_ta_uuid;
112 extern const TEEC_UUID os_test_ta_uuid;
113 extern const TEEC_UUID create_fail_test_ta_uuid;
114 extern const TEEC_UUID rpc_test_ta_uuid;
115 extern const TEEC_UUID sims_test_ta_uuid;
116 extern const TEEC_UUID miss_test_ta_uuid;
117 extern const TEEC_UUID sims_keepalive_test_ta_uuid;
118 extern const TEEC_UUID gp_tta_testing_client_api_uuid;
119 extern const TEEC_UUID gp_tta_answer_success_to_open_session_invoke_uuid;
120 extern const TEEC_UUID gp_tta_answer_error_to_invoke_uuid;
121 extern const TEEC_UUID gp_tta_answer_error_to_open_session_uuid;
122 extern const TEEC_UUID gp_tta_check_OpenSession_with_4_parameters_uuid;
123 extern const TEEC_UUID gp_tta_ds_uuid;
124 extern const TEEC_UUID storage_ta_uuid;
125 extern const TEEC_UUID storage2_ta_uuid;
126 extern const TEEC_UUID enc_fs_key_manager_test_ta_uuid;
127 extern const TEEC_UUID ecc_test_ta_uuid;
128 extern const TEEC_UUID pta_invoke_tests_ta_uuid;
129 extern const TEEC_UUID gp_tta_time_uuid;
130 extern const TEEC_UUID concurrent_ta_uuid;
131 extern const TEEC_UUID concurrent_large_ta_uuid;
132 extern const TEEC_UUID storage_benchmark_ta_uuid;
133 extern const TEEC_UUID socket_ta_uuid;
134 extern const TEEC_UUID sdp_basic_ta_uuid;
135 extern const TEEC_UUID tpm_log_test_ta_uuid;
136 extern const TEEC_UUID supp_plugin_test_ta_uuid;
137 extern const TEEC_UUID large_ta_uuid;
138 extern const TEEC_UUID bti_test_ta_uuid;
139 extern char *xtest_tee_name;
140 
141 #endif /*XTEST_TEST_H*/
142