]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/test/lib/nvmf/direct/direct_ut.c
bump version to 12.2.12-pve1
[ceph.git] / ceph / src / spdk / test / lib / nvmf / direct / direct_ut.c
1 /*-
2 * BSD LICENSE
3 *
4 * Copyright (c) Intel Corporation.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 #include <stdlib.h>
35 #include <unistd.h>
36 #include <errno.h>
37 #include <stdio.h>
38
39 #include "spdk_cunit.h"
40
41 #include "direct.c"
42
43 SPDK_LOG_REGISTER_TRACE_FLAG("nvmf", SPDK_TRACE_NVMF)
44
45 uint32_t
46 spdk_env_get_current_core(void)
47 {
48 return 0;
49 }
50
51 void
52 spdk_poller_register(struct spdk_poller **ppoller, spdk_poller_fn fn, void *arg,
53 uint32_t lcore, uint64_t period_microseconds)
54 {
55 return;
56 }
57
58 void
59 spdk_poller_unregister(struct spdk_poller **ppoller, struct spdk_event *complete)
60 {
61 return;
62 }
63
64 int32_t
65 spdk_nvme_ctrlr_process_admin_completions(struct spdk_nvme_ctrlr *ctrlr)
66 {
67 return -1;
68 }
69
70 void
71 spdk_trace_record(uint16_t tpoint_id, uint16_t poller_id, uint32_t size, uint64_t object_id,
72 uint64_t arg1)
73 {
74 }
75
76 uint32_t
77 spdk_nvme_ctrlr_get_num_ns(struct spdk_nvme_ctrlr *ctrlr)
78 {
79 return 0;
80 }
81
82 const struct spdk_nvme_ctrlr_data *
83 spdk_nvme_ctrlr_get_data(struct spdk_nvme_ctrlr *ctrlr)
84 {
85 return NULL;
86 }
87
88 void
89 spdk_nvme_ctrlr_register_aer_callback(struct spdk_nvme_ctrlr *ctrlr,
90 spdk_nvme_aer_cb aer_cb_fn,
91 void *aer_cb_arg)
92 {
93 }
94
95 int
96 spdk_nvme_ctrlr_cmd_io_raw(struct spdk_nvme_ctrlr *ctrlr,
97 struct spdk_nvme_qpair *qpair,
98 struct spdk_nvme_cmd *cmd,
99 void *buf, uint32_t len,
100 spdk_nvme_cmd_cb cb_fn, void *cb_arg)
101 {
102 return -1;
103 }
104
105 struct spdk_nvme_ns *spdk_nvme_ctrlr_get_ns(struct spdk_nvme_ctrlr *ctrlr, uint32_t ns_id)
106 {
107 return NULL;
108 }
109
110 bool
111 spdk_nvme_ns_is_active(struct spdk_nvme_ns *ns)
112 {
113 return false;
114 }
115
116 int
117 spdk_nvme_ctrlr_cmd_admin_raw(struct spdk_nvme_ctrlr *ctrlr,
118 struct spdk_nvme_cmd *cmd,
119 void *buf, uint32_t len,
120 spdk_nvme_cmd_cb cb_fn, void *cb_arg)
121 {
122 return -1;
123 }
124
125 union spdk_nvme_vs_register
126 spdk_nvme_ctrlr_get_regs_vs(struct spdk_nvme_ctrlr *ctrlr)
127 {
128 union spdk_nvme_vs_register vs;
129 vs.raw = 0;
130 return vs;
131 }
132
133 int
134 spdk_nvme_detach(struct spdk_nvme_ctrlr *ctrlr)
135 {
136 return -1;
137 }
138
139 struct spdk_nvme_qpair *
140 spdk_nvme_ctrlr_alloc_io_qpair(struct spdk_nvme_ctrlr *ctrlr, enum spdk_nvme_qprio qprio)
141 {
142 return NULL;
143 }
144
145 int32_t
146 spdk_nvme_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_completions)
147 {
148 return -1;
149 }
150 int
151 spdk_nvmf_request_complete(struct spdk_nvmf_request *req)
152 {
153 return -1;
154 }
155
156 int
157 spdk_nvmf_session_get_features_number_of_queues(struct spdk_nvmf_request *req)
158 {
159 return -1;
160 }
161
162 int spdk_nvmf_session_set_features_number_of_queues(struct spdk_nvmf_request *req)
163 {
164 return -1;
165 }
166
167 int
168 spdk_nvmf_session_set_features_host_identifier(struct spdk_nvmf_request *req)
169 {
170 return -1;
171 }
172
173 int
174 spdk_nvmf_session_get_features_host_identifier(struct spdk_nvmf_request *req)
175 {
176 return -1;
177 }
178 int
179 spdk_nvmf_session_set_features_keep_alive_timer(struct spdk_nvmf_request *req)
180 {
181 return -1;
182 }
183
184 int
185 spdk_nvmf_session_get_features_keep_alive_timer(struct spdk_nvmf_request *req)
186 {
187 return -1;
188 }
189
190 int
191 spdk_nvmf_session_set_features_async_event_configuration(struct spdk_nvmf_request *req)
192 {
193 return -1;
194 }
195
196 int
197 spdk_nvmf_session_get_features_async_event_configuration(struct spdk_nvmf_request *req)
198 {
199 return -1;
200 }
201
202 int
203 spdk_nvmf_session_async_event_request(struct spdk_nvmf_request *req)
204 {
205 return -1;
206 }
207
208 /* test suite function */
209 static void
210 nvmf_test_nvmf_direct_ctrlr_admin_identify_nslist(void)
211 {
212 }
213
214 int main(int argc, char **argv)
215 {
216 CU_pSuite suite = NULL;
217 unsigned int num_failures;
218
219 if (CU_initialize_registry() != CUE_SUCCESS) {
220 return CU_get_error();
221 }
222
223 suite = CU_add_suite("nvmf", NULL, NULL);
224 if (suite == NULL) {
225 CU_cleanup_registry();
226 return CU_get_error();
227 }
228
229 if (CU_add_test(suite, "direct_ctrlr_admin_identify_nslist",
230 nvmf_test_nvmf_direct_ctrlr_admin_identify_nslist) == NULL) {
231 CU_cleanup_registry();
232 return CU_get_error();
233 }
234
235 CU_basic_set_mode(CU_BRM_VERBOSE);
236 CU_basic_run_tests();
237 num_failures = CU_get_number_of_failures();
238 CU_cleanup_registry();
239 return num_failures;
240 }