Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright (C) 2018 Intel Corporation.
3 : : * All rights reserved.
4 : : * Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
5 : : */
6 : :
7 : : #include "spdk_internal/cunit.h"
8 : :
9 : : #include "common/lib/ut_multithread.c"
10 : : #include "unit/lib/json_mock.c"
11 : :
12 : : #include "spdk/config.h"
13 : : /* HACK: disable VTune integration so the unit test doesn't need VTune headers and libs to build */
14 : : #undef SPDK_CONFIG_VTUNE
15 : :
16 : : #include "bdev/bdev.c"
17 : : #include "bdev/part.c"
18 : :
19 : : struct ut_expected_io {
20 : : };
21 : :
22 : : struct bdev_ut_channel {
23 : : TAILQ_HEAD(, spdk_bdev_io) outstanding_io;
24 : : uint32_t outstanding_io_count;
25 : : TAILQ_HEAD(, ut_expected_io) expected_io;
26 : : };
27 : :
28 : : static uint32_t g_part_ut_io_device;
29 : : static struct bdev_ut_channel *g_bdev_ut_channel;
30 : : static int g_accel_io_device;
31 : :
32 [ - + - + ]: 72 : DEFINE_STUB(spdk_notify_send, uint64_t, (const char *type, const char *ctx), 0);
33 [ - + # # ]: 8 : DEFINE_STUB(spdk_notify_type_register, struct spdk_notify_type *, (const char *type), NULL);
34 [ # # # # ]: 0 : DEFINE_STUB(spdk_memory_domain_get_dma_device_id, const char *, (struct spdk_memory_domain *domain),
35 : : "test_domain");
36 [ # # # # ]: 0 : DEFINE_STUB(spdk_memory_domain_get_dma_device_type, enum spdk_dma_device_type,
37 : : (struct spdk_memory_domain *domain), 0);
38 : 0 : DEFINE_STUB_V(spdk_accel_sequence_finish,
39 : : (struct spdk_accel_sequence *seq, spdk_accel_completion_cb cb_fn, void *cb_arg));
40 : 0 : DEFINE_STUB_V(spdk_accel_sequence_abort, (struct spdk_accel_sequence *seq));
41 : 0 : DEFINE_STUB_V(spdk_accel_sequence_reverse, (struct spdk_accel_sequence *seq));
42 [ # # # # ]: 0 : DEFINE_STUB(spdk_accel_append_copy, int,
43 : : (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch, struct iovec *dst_iovs,
44 : : uint32_t dst_iovcnt, struct spdk_memory_domain *dst_domain, void *dst_domain_ctx,
45 : : struct iovec *src_iovs, uint32_t src_iovcnt, struct spdk_memory_domain *src_domain,
46 : : void *src_domain_ctx, spdk_accel_step_cb cb_fn, void *cb_arg), 0);
47 [ # # # # ]: 0 : DEFINE_STUB(spdk_accel_append_dif_verify_copy, int,
48 : : (struct spdk_accel_sequence **seq, struct spdk_io_channel *ch,
49 : : struct iovec *dst_iovs, size_t dst_iovcnt,
50 : : struct spdk_memory_domain *dst_domain, void *dst_domain_ctx,
51 : : struct iovec *src_iovs, size_t src_iovcnt,
52 : : struct spdk_memory_domain *src_domain, void *src_domain_ctx,
53 : : uint32_t num_blocks,
54 : : const struct spdk_dif_ctx *ctx, struct spdk_dif_error *err,
55 : : spdk_accel_step_cb cb_fn, void *cb_arg), 0);
56 [ # # # # ]: 0 : DEFINE_STUB(spdk_accel_append_dif_generate_copy, int,
57 : : (struct spdk_accel_sequence **seq,
58 : : struct spdk_io_channel *ch,
59 : : struct iovec *dst_iovs, size_t dst_iovcnt,
60 : : struct spdk_memory_domain *dst_domain, void *dst_domain_ctx,
61 : : struct iovec *src_iovs, size_t src_iovcnt,
62 : : struct spdk_memory_domain *src_domain, void *src_domain_ctx,
63 : : uint32_t num_blocks, const struct spdk_dif_ctx *ctx,
64 : : spdk_accel_step_cb cb_fn, void *cb_arg), 0);
65 [ # # # # ]: 0 : DEFINE_STUB(spdk_accel_get_memory_domain, struct spdk_memory_domain *, (void), NULL);
66 [ # # # # ]: 0 : DEFINE_STUB(spdk_accel_get_buf, int, (struct spdk_io_channel *ch, uint64_t len, void **buf,
67 : : struct spdk_memory_domain **domain, void **domain_ctx), 0);
68 : 0 : DEFINE_STUB_V(spdk_accel_put_buf, (struct spdk_io_channel *ch, void *buf,
69 : : struct spdk_memory_domain *domain, void *domain_ctx));
70 : :
71 [ # # ]: 0 : DEFINE_RETURN_MOCK(spdk_memory_domain_pull_data, int);
72 : : int
73 : 0 : spdk_memory_domain_pull_data(struct spdk_memory_domain *src_domain, void *src_domain_ctx,
74 : : struct iovec *src_iov, uint32_t src_iov_cnt, struct iovec *dst_iov, uint32_t dst_iov_cnt,
75 : : spdk_memory_domain_data_cpl_cb cpl_cb, void *cpl_cb_arg)
76 : : {
77 [ # # # # : 0 : HANDLE_RETURN_MOCK(spdk_memory_domain_pull_data);
# # ]
78 : :
79 : 0 : cpl_cb(cpl_cb_arg, 0);
80 : 0 : return 0;
81 : 0 : }
82 : :
83 [ # # ]: 0 : DEFINE_RETURN_MOCK(spdk_memory_domain_push_data, int);
84 : : int
85 : 0 : spdk_memory_domain_push_data(struct spdk_memory_domain *dst_domain, void *dst_domain_ctx,
86 : : struct iovec *dst_iov, uint32_t dst_iovcnt, struct iovec *src_iov, uint32_t src_iovcnt,
87 : : spdk_memory_domain_data_cpl_cb cpl_cb, void *cpl_cb_arg)
88 : : {
89 [ # # # # : 0 : HANDLE_RETURN_MOCK(spdk_memory_domain_push_data);
# # ]
90 : :
91 : 0 : cpl_cb(cpl_cb_arg, 0);
92 : 0 : return 0;
93 : 0 : }
94 : :
95 : : struct spdk_io_channel *
96 : 8 : spdk_accel_get_io_channel(void)
97 : : {
98 : 8 : return spdk_get_io_channel(&g_accel_io_device);
99 : : }
100 : :
101 : : static int
102 : 4 : ut_accel_ch_create_cb(void *io_device, void *ctx)
103 : : {
104 : 4 : return 0;
105 : : }
106 : :
107 : : static void
108 : 4 : ut_accel_ch_destroy_cb(void *io_device, void *ctx)
109 : : {
110 : 4 : }
111 : :
112 : : static int
113 : 4 : ut_part_setup(void)
114 : : {
115 : 4 : spdk_io_device_register(&g_accel_io_device, ut_accel_ch_create_cb,
116 : : ut_accel_ch_destroy_cb, 0, NULL);
117 : 4 : return 0;
118 : : }
119 : :
120 : : static int
121 : 4 : ut_part_teardown(void)
122 : : {
123 : 4 : spdk_io_device_unregister(&g_accel_io_device, NULL);
124 : :
125 : 4 : return 0;
126 : : }
127 : :
128 : : static void
129 : 12 : _part_cleanup(struct spdk_bdev_part *part)
130 : : {
131 : 12 : spdk_io_device_unregister(part, NULL);
132 : 12 : free(part->internal.bdev.name);
133 : 12 : free(part->internal.bdev.product_name);
134 : 12 : }
135 : :
136 : : static struct spdk_io_channel *
137 : 4 : part_ut_get_io_channel(void *ctx)
138 : : {
139 : 4 : return spdk_get_io_channel(&g_part_ut_io_device);
140 : : }
141 : :
142 : : void
143 : 0 : spdk_scsi_nvme_translate(const struct spdk_bdev_io *bdev_io,
144 : : int *sc, int *sk, int *asc, int *ascq)
145 : : {
146 : 0 : }
147 : :
148 : : static int
149 : 4 : bdev_ut_create_ch(void *io_device, void *ctx_buf)
150 : : {
151 : 4 : struct bdev_ut_channel *ch = ctx_buf;
152 : :
153 : 4 : CU_ASSERT(g_bdev_ut_channel == NULL);
154 : 4 : g_bdev_ut_channel = ch;
155 : 4 : g_part_ut_io_device++;
156 : :
157 : 4 : TAILQ_INIT(&ch->outstanding_io);
158 : 4 : ch->outstanding_io_count = 0;
159 : 4 : TAILQ_INIT(&ch->expected_io);
160 : 4 : return 0;
161 : : }
162 : :
163 : : static void
164 : 4 : bdev_ut_destroy_ch(void *io_device, void *ctx_buf)
165 : : {
166 : 4 : CU_ASSERT(g_bdev_ut_channel != NULL);
167 : 4 : g_bdev_ut_channel = NULL;
168 : 4 : g_part_ut_io_device--;
169 : 4 : }
170 : :
171 : : struct spdk_bdev_module bdev_ut_if;
172 : :
173 : : static int
174 : 4 : bdev_ut_module_init(void)
175 : : {
176 : 4 : spdk_io_device_register(&g_part_ut_io_device, bdev_ut_create_ch, bdev_ut_destroy_ch,
177 : : sizeof(struct bdev_ut_channel), NULL);
178 : 4 : spdk_bdev_module_init_done(&bdev_ut_if);
179 : 4 : return 0;
180 : : }
181 : :
182 : : static void
183 : 4 : bdev_ut_module_fini(void)
184 : : {
185 : 4 : spdk_io_device_unregister(&g_part_ut_io_device, NULL);
186 : 4 : }
187 : :
188 : : struct spdk_bdev_module bdev_ut_if = {
189 : : .name = "bdev_ut",
190 : : .module_init = bdev_ut_module_init,
191 : : .module_fini = bdev_ut_module_fini,
192 : : .async_init = true,
193 : : };
194 : :
195 : : static void vbdev_ut_examine(struct spdk_bdev *bdev);
196 : :
197 : : static int
198 : 4 : vbdev_ut_module_init(void)
199 : : {
200 : 4 : return 0;
201 : : }
202 : :
203 : : static void
204 : 4 : vbdev_ut_module_fini(void)
205 : : {
206 : 4 : }
207 : :
208 : : struct spdk_bdev_module vbdev_ut_if = {
209 : : .name = "vbdev_ut",
210 : : .module_init = vbdev_ut_module_init,
211 : : .module_fini = vbdev_ut_module_fini,
212 : : .examine_config = vbdev_ut_examine,
213 : : };
214 : :
215 : 4 : SPDK_BDEV_MODULE_REGISTER(bdev_ut, &bdev_ut_if)
216 : 4 : SPDK_BDEV_MODULE_REGISTER(vbdev_ut, &vbdev_ut_if)
217 : :
218 : : static void
219 : 36 : vbdev_ut_examine(struct spdk_bdev *bdev)
220 : : {
221 : 36 : spdk_bdev_module_examine_done(&vbdev_ut_if);
222 : 36 : }
223 : :
224 : : static int
225 : 36 : __destruct(void *ctx)
226 : : {
227 : 36 : return 0;
228 : : }
229 : :
230 : : static bool
231 : 108 : __io_type_supported(void *ctx, enum spdk_bdev_io_type type)
232 : : {
233 : 108 : return true;
234 : : }
235 : :
236 : : static struct spdk_bdev_fn_table base_fn_table = {
237 : : .destruct = __destruct,
238 : : .get_io_channel = part_ut_get_io_channel,
239 : : .io_type_supported = __io_type_supported,
240 : : };
241 : : static struct spdk_bdev_fn_table part_fn_table = {
242 : : .destruct = __destruct,
243 : : .io_type_supported = __io_type_supported,
244 : : };
245 : :
246 : : static void
247 : 4 : bdev_init_cb(void *arg, int rc)
248 : : {
249 : 4 : CU_ASSERT(rc == 0);
250 : 4 : }
251 : :
252 : : static void
253 : 8 : bdev_fini_cb(void *arg)
254 : : {
255 : 8 : }
256 : :
257 : : static void
258 : 4 : ut_init_bdev(void)
259 : : {
260 : : int rc;
261 : :
262 : 4 : rc = spdk_iobuf_initialize();
263 : 4 : CU_ASSERT(rc == 0);
264 : :
265 : 4 : spdk_bdev_initialize(bdev_init_cb, NULL);
266 : 4 : poll_threads();
267 : 4 : }
268 : :
269 : : static void
270 : 4 : ut_fini_bdev(void)
271 : : {
272 : 4 : spdk_bdev_finish(bdev_fini_cb, NULL);
273 : 4 : spdk_iobuf_finish(bdev_fini_cb, NULL);
274 : 4 : poll_threads();
275 : 4 : }
276 : :
277 : : static void
278 : 0 : bdev_ut_event_cb(enum spdk_bdev_event_type type, struct spdk_bdev *bdev, void *event_ctx)
279 : : {
280 : 0 : }
281 : :
282 : : static void
283 : 4 : part_test(void)
284 : : {
285 : 3 : struct spdk_bdev_part_base *base;
286 : 4 : struct spdk_bdev_part part1 = {};
287 : 4 : struct spdk_bdev_part part2 = {};
288 : 4 : struct spdk_bdev_part part3 = {};
289 : 4 : struct spdk_bdev bdev_base = {};
290 : 4 : SPDK_BDEV_PART_TAILQ tailq = TAILQ_HEAD_INITIALIZER(tailq);
291 : : int rc;
292 : :
293 : 4 : bdev_base.name = "base";
294 : 4 : bdev_base.fn_table = &base_fn_table;
295 : 4 : bdev_base.module = &bdev_ut_if;
296 : 4 : rc = spdk_bdev_register(&bdev_base);
297 : 4 : CU_ASSERT(rc == 0);
298 : 4 : rc = spdk_bdev_part_base_construct_ext("base", NULL, &vbdev_ut_if,
299 : : &part_fn_table, &tailq, NULL,
300 : : NULL, 0, NULL, NULL, &base);
301 : :
302 : 4 : CU_ASSERT(rc == 0);
303 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(base != NULL);
304 : :
305 : 4 : rc = spdk_bdev_part_construct(&part1, base, "test1", 0, 100, "test");
306 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(rc == 0);
307 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(base->ref == 1);
308 [ + + - + ]: 4 : SPDK_CU_ASSERT_FATAL(base->claimed == true);
309 : 4 : rc = spdk_bdev_part_construct(&part2, base, "test2", 100, 100, "test");
310 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(rc == 0);
311 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(base->ref == 2);
312 [ + + - + ]: 4 : SPDK_CU_ASSERT_FATAL(base->claimed == true);
313 : 4 : rc = spdk_bdev_part_construct(&part3, base, "test1", 0, 100, "test");
314 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(rc != 0);
315 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(base->ref == 2);
316 [ - + - + ]: 4 : SPDK_CU_ASSERT_FATAL(base->claimed == true);
317 : :
318 : 4 : spdk_bdev_part_base_hotremove(base, &tailq);
319 : :
320 : 4 : spdk_bdev_part_base_free(base);
321 : 4 : _part_cleanup(&part1);
322 : 4 : _part_cleanup(&part2);
323 : 4 : spdk_bdev_unregister(&bdev_base, NULL, NULL);
324 : :
325 : 4 : poll_threads();
326 : 4 : }
327 : :
328 : : static void
329 : 4 : part_free_test(void)
330 : : {
331 : 4 : struct spdk_bdev_part_base *base = NULL;
332 : : struct spdk_bdev_part *part;
333 : 4 : struct spdk_bdev bdev_base = {};
334 : 4 : SPDK_BDEV_PART_TAILQ tailq = TAILQ_HEAD_INITIALIZER(tailq);
335 : : int rc;
336 : :
337 : 4 : bdev_base.name = "base";
338 : 4 : bdev_base.fn_table = &base_fn_table;
339 : 4 : bdev_base.module = &bdev_ut_if;
340 : 4 : rc = spdk_bdev_register(&bdev_base);
341 : 4 : CU_ASSERT(rc == 0);
342 : 4 : poll_threads();
343 : :
344 : 4 : rc = spdk_bdev_part_base_construct_ext("base", NULL, &vbdev_ut_if,
345 : : &part_fn_table, &tailq, NULL,
346 : : NULL, 0, NULL, NULL, &base);
347 : 4 : CU_ASSERT(rc == 0);
348 : 4 : CU_ASSERT(TAILQ_EMPTY(&tailq));
349 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(base != NULL);
350 : :
351 : 4 : part = calloc(1, sizeof(*part));
352 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(part != NULL);
353 : 4 : rc = spdk_bdev_part_construct(part, base, "test", 0, 100, "test");
354 [ - + ]: 4 : SPDK_CU_ASSERT_FATAL(rc == 0);
355 : 4 : poll_threads();
356 : 4 : CU_ASSERT(!TAILQ_EMPTY(&tailq));
357 : :
358 : 4 : spdk_bdev_unregister(&part->internal.bdev, NULL, NULL);
359 : 4 : poll_threads();
360 : :
361 : 4 : rc = spdk_bdev_part_free(part);
362 : 4 : CU_ASSERT(rc == 1);
363 : 4 : poll_threads();
364 : 4 : CU_ASSERT(TAILQ_EMPTY(&tailq));
365 : :
366 : 4 : spdk_bdev_unregister(&bdev_base, NULL, NULL);
367 : 4 : poll_threads();
368 : 4 : }
369 : :
370 : : static void
371 : 4 : part_get_io_channel_test(void)
372 : : {
373 : 4 : struct spdk_bdev_part_base *base = NULL;
374 : 4 : struct spdk_bdev_desc *desc = NULL;
375 : : struct spdk_io_channel *io_ch;
376 : : struct spdk_bdev_part *part;
377 : 4 : struct spdk_bdev bdev_base = {};
378 : 4 : SPDK_BDEV_PART_TAILQ tailq = TAILQ_HEAD_INITIALIZER(tailq);
379 : : int rc;
380 : :
381 : 4 : ut_init_bdev();
382 : 4 : bdev_base.name = "base";
383 : 4 : bdev_base.blocklen = 512;
384 : 4 : bdev_base.blockcnt = 1024;
385 : 4 : bdev_base.fn_table = &base_fn_table;
386 : 4 : bdev_base.module = &bdev_ut_if;
387 : 4 : rc = spdk_bdev_register(&bdev_base);
388 : 4 : CU_ASSERT(rc == 0);
389 : :
390 : 4 : rc = spdk_bdev_part_base_construct_ext("base", NULL, &vbdev_ut_if,
391 : : &part_fn_table, &tailq, NULL,
392 : : NULL, 100, NULL, NULL, &base);
393 : 4 : CU_ASSERT(rc == 0);
394 : 4 : CU_ASSERT(TAILQ_EMPTY(&tailq));
395 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(base != NULL);
396 : :
397 : 4 : part = calloc(1, sizeof(*part));
398 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(part != NULL);
399 : 4 : rc = spdk_bdev_part_construct(part, base, "test", 0, 100, "test");
400 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(rc == 0);
401 : 4 : CU_ASSERT(!TAILQ_EMPTY(&tailq));
402 : :
403 : 4 : rc = spdk_bdev_open_ext("test", true, bdev_ut_event_cb, NULL, &desc);
404 : 4 : CU_ASSERT(rc == 0);
405 [ - + ]: 4 : SPDK_CU_ASSERT_FATAL(desc != NULL);
406 : 4 : CU_ASSERT(&part->internal.bdev == spdk_bdev_desc_get_bdev(desc));
407 : :
408 : 4 : io_ch = spdk_bdev_get_io_channel(desc);
409 : 4 : CU_ASSERT(io_ch != NULL);
410 : 4 : CU_ASSERT(g_part_ut_io_device == 1);
411 : :
412 : 4 : spdk_put_io_channel(io_ch);
413 : 4 : spdk_bdev_close(desc);
414 : 4 : spdk_bdev_unregister(&part->internal.bdev, NULL, NULL);
415 : 4 : poll_threads();
416 : 4 : CU_ASSERT(g_part_ut_io_device == 0);
417 : :
418 : 4 : rc = spdk_bdev_part_free(part);
419 : 4 : CU_ASSERT(rc == 1);
420 : 4 : poll_threads();
421 : 4 : CU_ASSERT(TAILQ_EMPTY(&tailq));
422 : :
423 : 4 : spdk_bdev_unregister(&bdev_base, NULL, NULL);
424 : 4 : ut_fini_bdev();
425 : 4 : }
426 : :
427 : : static void
428 : 4 : part_construct_ext(void)
429 : : {
430 : 3 : struct spdk_bdev_part_base *base;
431 : 4 : struct spdk_bdev_part part1 = {};
432 : 4 : struct spdk_bdev bdev_base = {};
433 : 4 : SPDK_BDEV_PART_TAILQ tailq = TAILQ_HEAD_INITIALIZER(tailq);
434 : 4 : const char *uuid = "7ed764b7-a841-41b1-ba93-6548d9335a44";
435 : 3 : struct spdk_bdev_part_construct_opts opts;
436 : : int rc;
437 : :
438 : 4 : bdev_base.name = "base";
439 : 4 : bdev_base.fn_table = &base_fn_table;
440 : 4 : bdev_base.module = &bdev_ut_if;
441 : 4 : rc = spdk_bdev_register(&bdev_base);
442 : 4 : CU_ASSERT(rc == 0);
443 : 4 : rc = spdk_bdev_part_base_construct_ext("base", NULL, &vbdev_ut_if,
444 : : &part_fn_table, &tailq, NULL,
445 : : NULL, 0, NULL, NULL, &base);
446 : :
447 : 4 : CU_ASSERT(rc == 0);
448 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(base != NULL);
449 : :
450 : : /* Verify opts.uuid is used as bdev UUID */
451 : 4 : spdk_bdev_part_construct_opts_init(&opts, sizeof(opts));
452 : 4 : spdk_uuid_parse(&opts.uuid, uuid);
453 : 4 : rc = spdk_bdev_part_construct_ext(&part1, base, "test1", 0, 100, "test", &opts);
454 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(rc == 0);
455 [ + + ]: 4 : SPDK_CU_ASSERT_FATAL(base->ref == 1);
456 [ - + - + ]: 4 : SPDK_CU_ASSERT_FATAL(base->claimed == true);
457 : 4 : CU_ASSERT(spdk_bdev_get_by_name(uuid) != NULL);
458 : 4 : CU_ASSERT(spdk_bdev_get_by_name("test1") != NULL);
459 : :
460 : : /* Clean up */
461 : 4 : spdk_bdev_part_base_hotremove(base, &tailq);
462 : 4 : spdk_bdev_part_base_free(base);
463 : 4 : _part_cleanup(&part1);
464 : 4 : spdk_bdev_unregister(&bdev_base, NULL, NULL);
465 : :
466 : 4 : poll_threads();
467 : 4 : }
468 : :
469 : : int
470 : 4 : main(int argc, char **argv)
471 : : {
472 : 4 : CU_pSuite suite = NULL;
473 : : unsigned int num_failures;
474 : :
475 : 4 : CU_initialize_registry();
476 : :
477 : 4 : suite = CU_add_suite("bdev_part", ut_part_setup, ut_part_teardown);
478 : :
479 : 4 : CU_ADD_TEST(suite, part_test);
480 : 4 : CU_ADD_TEST(suite, part_free_test);
481 : 4 : CU_ADD_TEST(suite, part_get_io_channel_test);
482 : 4 : CU_ADD_TEST(suite, part_construct_ext);
483 : :
484 : 4 : allocate_cores(1);
485 : 4 : allocate_threads(1);
486 : 4 : set_thread(0);
487 : :
488 : 4 : num_failures = spdk_ut_run_tests(argc, argv, NULL);
489 : 4 : CU_cleanup_registry();
490 : :
491 : 4 : free_threads();
492 : 4 : free_cores();
493 : :
494 : 4 : return num_failures;
495 : : }
|