]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | include(AddCephTest) |
2 | ||
11fdf7f2 TL |
3 | set(UNITTEST_LIBS GMock::Main GMock::GMock GTest::GTest ${CMAKE_THREAD_LIBS_INIT} |
4 | ${GSSAPI_LIBRARIES} ${OPENLDAP_LIBRARIES} ${CMAKE_DL_LIBS}) | |
7c673cae FG |
5 | |
6 | add_library(unit-main OBJECT unit.cc) | |
11fdf7f2 TL |
7 | target_include_directories(unit-main PRIVATE |
8 | $<TARGET_PROPERTY:GTest::GTest,INTERFACE_INCLUDE_DIRECTORIES>) | |
7c673cae | 9 | |
7c673cae FG |
10 | add_subdirectory(cls_hello) |
11 | add_subdirectory(cls_lock) | |
12 | add_subdirectory(cls_log) | |
13 | add_subdirectory(cls_numops) | |
14 | add_subdirectory(cls_sdk) | |
15 | if(WITH_RBD) | |
3efd9988 | 16 | add_subdirectory(cls_journal) |
7c673cae FG |
17 | add_subdirectory(cls_rbd) |
18 | endif(WITH_RBD) | |
19 | add_subdirectory(cls_refcount) | |
7c673cae | 20 | add_subdirectory(cls_rgw) |
7c673cae FG |
21 | add_subdirectory(cls_version) |
22 | add_subdirectory(cls_lua) | |
23 | add_subdirectory(common) | |
24 | add_subdirectory(compressor) | |
25 | add_subdirectory(crush) | |
26 | add_subdirectory(direct_messenger) | |
27 | add_subdirectory(encoding) | |
28 | add_subdirectory(erasure-code) | |
29 | add_subdirectory(filestore) | |
30 | add_subdirectory(fs) | |
31 | add_subdirectory(journal) | |
7c673cae FG |
32 | add_subdirectory(libcephfs) |
33 | add_subdirectory(librados) | |
34 | add_subdirectory(librados_test_stub) | |
11fdf7f2 TL |
35 | if(WITH_LIBRADOSSTRIPER) |
36 | add_subdirectory(libradosstriper) | |
37 | endif() | |
7c673cae FG |
38 | if(WITH_RBD) |
39 | add_subdirectory(librbd) | |
40 | endif(WITH_RBD) | |
41 | add_subdirectory(messenger) | |
11fdf7f2 TL |
42 | if (WITH_CEPHFS) |
43 | add_subdirectory(mds) | |
44 | endif() | |
7c673cae | 45 | add_subdirectory(mon) |
31f18b77 | 46 | add_subdirectory(mgr) |
7c673cae FG |
47 | add_subdirectory(msgr) |
48 | add_subdirectory(ObjectMap) | |
49 | add_subdirectory(objectstore) | |
50 | add_subdirectory(os) | |
51 | add_subdirectory(osd) | |
52 | add_subdirectory(osdc) | |
53 | add_subdirectory(pybind) | |
11fdf7f2 TL |
54 | if(WITH_RADOSGW) |
55 | set(rgw_libs rgw_a) | |
56 | if(WITH_RADOSGW_AMQP_ENDPOINT) | |
57 | list(APPEND rgw_libs amqp_mock) | |
58 | endif() | |
7c673cae | 59 | add_subdirectory(rgw) |
11fdf7f2 | 60 | endif(WITH_RADOSGW) |
7c673cae FG |
61 | if(WITH_RBD) |
62 | add_subdirectory(rbd_mirror) | |
63 | endif(WITH_RBD) | |
11fdf7f2 TL |
64 | if(WITH_SEASTAR) |
65 | add_subdirectory(crimson) | |
66 | endif() | |
7c673cae | 67 | add_subdirectory(system) |
11fdf7f2 | 68 | if(WITH_FIO OR WITH_SYSTEM_FIO) |
7c673cae FG |
69 | add_subdirectory(fio) |
70 | endif() | |
71 | ||
72 | # test_timers | |
73 | add_executable(ceph_test_timers | |
74 | TestTimers.cc | |
75 | ) | |
76 | target_link_libraries(ceph_test_timers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
77 | ||
78 | # test_signal_handlers | |
79 | add_executable(ceph_test_signal_handlers | |
80 | TestSignalHandlers.cc | |
81 | ) | |
82 | target_link_libraries(ceph_test_signal_handlers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
83 | ||
84 | # test_rewrite_latency | |
85 | add_executable(ceph_test_rewrite_latency | |
86 | test_rewrite_latency.cc | |
87 | ) | |
88 | target_link_libraries(ceph_test_rewrite_latency ceph-common | |
89 | ${CMAKE_DL_LIBS} | |
90 | ${CMAKE_THREAD_LIBS_INIT} ${CRYPTO_LIBS} m ${EXTRALIBS}) | |
91 | ||
92 | # test_crypt | |
93 | add_executable(test_crypto | |
94 | testcrypto.cc | |
95 | ) | |
96 | target_link_libraries(test_crypto | |
97 | global | |
98 | ${CRYPTO_LIBS} | |
99 | m | |
100 | ${EXTRALIBS} | |
101 | ${BLKID_LIBRARIES} | |
102 | ${CMAKE_DL_LIBS} | |
103 | ) | |
104 | ||
105 | add_executable(test_build_libcommon buildtest_skeleton.cc) | |
106 | target_link_libraries(test_build_libcommon ceph-common pthread ${CRYPTO_LIBS} ${EXTRALIBS}) | |
107 | ||
108 | if(WITH_RADOSGW) | |
109 | add_executable(test_build_librgw buildtest_skeleton.cc) | |
110 | target_link_libraries(test_build_librgw rgw_a pthread ${CRYPTO_LIBS} ${EXTRALIBS}) | |
111 | endif(WITH_RADOSGW) | |
112 | ||
11fdf7f2 TL |
113 | if(WITH_RADOSGW) |
114 | add_executable(test_build_librgw_admin_user buildtest_skeleton.cc) | |
115 | target_link_libraries(test_build_librgw_admin_user pthread ${CRYPTO_LIBS} ${EXTRALIBS}) | |
116 | endif(WITH_RADOSGW) | |
117 | ||
7c673cae FG |
118 | if(WITH_LIBCEPHFS) |
119 | # From src/test/Makefile-client.am: I dont get this one... testing the osdc build but link in libcephfs? | |
120 | add_executable(test_build_libcephfs buildtest_skeleton.cc) | |
121 | target_link_libraries(test_build_libcephfs cephfs pthread ${CRYPTO_LIBS} ${EXTRALIBS}) | |
122 | endif(WITH_LIBCEPHFS) | |
123 | ||
124 | add_executable(test_build_librados buildtest_skeleton.cc) | |
125 | target_link_libraries(test_build_librados librados pthread ${CRYPTO_LIBS} ${EXTRALIBS} osdc osd os ceph-common cls_lock_client ${BLKID_LIBRARIES}) | |
126 | ||
127 | # bench_log | |
128 | set(bench_log_srcs | |
129 | bench_log.cc | |
130 | ) | |
131 | add_executable(ceph_bench_log | |
132 | ${bench_log_srcs} | |
133 | ) | |
134 | target_link_libraries(ceph_bench_log global pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
135 | ||
136 | # ceph_test_mutate | |
137 | add_executable(ceph_test_mutate | |
138 | test_mutate.cc | |
139 | ) | |
140 | target_link_libraries(ceph_test_mutate global librados ${BLKID_LIBRARIES} | |
141 | ${CMAKE_DL_LIBS}) | |
142 | ||
143 | # test_trans | |
144 | add_executable(test_trans | |
145 | test_trans.cc | |
146 | ) | |
147 | target_link_libraries(test_trans os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
148 | ||
149 | ## Benchmarks | |
150 | ||
151 | ||
152 | # ceph_omapbench | |
153 | set(omapbench_srcs | |
154 | omap_bench.cc | |
155 | ) | |
156 | add_executable(ceph_omapbench | |
157 | ${omapbench_srcs} | |
158 | ) | |
159 | target_link_libraries(ceph_omapbench | |
160 | librados | |
31f18b77 | 161 | Boost::program_options |
7c673cae FG |
162 | global |
163 | ${BLKID_LIBRARIES} | |
164 | ${CMAKE_DL_LIBS} | |
165 | ) | |
166 | ||
167 | if(WITH_KVS) | |
168 | # ceph_kvstorebench | |
169 | set(kvstorebench_srcs | |
170 | kv_store_bench.cc | |
171 | ${CMAKE_SOURCE_DIR}/src/key_value_store/kv_flat_btree_async.cc | |
172 | ) | |
173 | add_executable(ceph_kvstorebench ${kvstorebench_srcs}) | |
174 | target_link_libraries(ceph_kvstorebench librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) | |
175 | install(TARGETS ceph_kvstorebench DESTINATION bin) | |
176 | endif(WITH_KVS) | |
177 | ||
178 | # ceph_objectstore_bench | |
179 | add_executable(ceph_objectstore_bench objectstore_bench.cc) | |
180 | target_link_libraries(ceph_objectstore_bench os global ${BLKID_LIBRARIES}) | |
181 | ||
182 | if(${WITH_RADOSGW}) | |
183 | # test_cors | |
184 | set(test_cors_srcs test_cors.cc) | |
185 | add_executable(test_cors | |
186 | ${test_cors_srcs} | |
187 | ) | |
188 | target_link_libraries(test_cors | |
189 | librados | |
11fdf7f2 | 190 | ${rgw_libs} |
7c673cae FG |
191 | global |
192 | ${BLKID_LIBRARIES} | |
193 | ${CURL_LIBRARIES} | |
194 | ${EXPAT_LIBRARIES} | |
195 | ${CMAKE_DL_LIBS} ${UNITTEST_LIBS}) | |
7c673cae FG |
196 | |
197 | # ceph_test_cls_rgw_meta | |
198 | set(test_cls_rgw_meta_srcs test_rgw_admin_meta.cc) | |
199 | add_executable(ceph_test_cls_rgw_meta | |
200 | ${test_cls_rgw_meta_srcs} | |
201 | ) | |
202 | target_link_libraries(ceph_test_cls_rgw_meta | |
203 | librados | |
11fdf7f2 | 204 | ${rgw_libs} |
7c673cae FG |
205 | global |
206 | cls_version_client | |
207 | cls_log_client | |
7c673cae FG |
208 | cls_refcount_client |
209 | cls_rgw_client | |
210 | cls_user_client | |
211 | cls_lock_client | |
7c673cae FG |
212 | ${BLKID_LIBRARIES} |
213 | ${CURL_LIBRARIES} | |
214 | ${EXPAT_LIBRARIES} | |
215 | ${CMAKE_DL_LIBS} ${UNITTEST_LIBS} ${CRYPTO_LIBS}) | |
7c673cae FG |
216 | |
217 | install(TARGETS | |
218 | ceph_test_cls_rgw_meta | |
219 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
220 | ||
221 | # ceph_test_cls_rgw_log | |
222 | set(ceph_test_cls_rgw_log_srcs | |
223 | test_rgw_admin_log.cc | |
224 | ) | |
225 | add_executable(ceph_test_cls_rgw_log | |
226 | ${ceph_test_cls_rgw_log_srcs} | |
227 | ) | |
228 | target_link_libraries(ceph_test_cls_rgw_log | |
229 | librados | |
11fdf7f2 | 230 | ${rgw_libs} |
7c673cae FG |
231 | global |
232 | cls_version_client | |
233 | cls_log_client | |
7c673cae FG |
234 | cls_refcount_client |
235 | cls_rgw_client | |
236 | cls_user_client | |
237 | cls_lock_client | |
7c673cae FG |
238 | ${BLKID_LIBRARIES} |
239 | ${CURL_LIBRARIES} | |
240 | ${EXPAT_LIBRARIES} | |
241 | ${CMAKE_DL_LIBS} | |
242 | ${UNITTEST_LIBS} | |
243 | ${EXTRALIBS} | |
244 | ${CRYPTO_LIBS} | |
245 | ) | |
7c673cae FG |
246 | |
247 | # ceph_test_librgw_file (nfs-like RGW interface) | |
248 | add_executable(ceph_test_librgw_file | |
249 | librgw_file.cc | |
250 | ) | |
31f18b77 | 251 | if(WITH_RADOSGW_FCGI_FRONTEND) |
11fdf7f2 | 252 | target_include_directories(ceph_test_librgw_file SYSTEM PRIVATE ${FCGI_INCLUDE_DIR}) |
31f18b77 | 253 | endif(WITH_RADOSGW_FCGI_FRONTEND) |
7c673cae FG |
254 | target_link_libraries(ceph_test_librgw_file |
255 | rgw | |
256 | librados | |
257 | ceph-common | |
258 | ${UNITTEST_LIBS} | |
259 | ${EXTRALIBS} | |
260 | ) | |
261 | ||
262 | # ceph_test_librgw_file_cd (just the rgw_file create-delete bucket ops) | |
263 | add_executable(ceph_test_librgw_file_cd | |
264 | librgw_file_cd.cc | |
265 | ) | |
7c673cae FG |
266 | target_link_libraries(ceph_test_librgw_file_cd |
267 | rgw | |
268 | librados | |
269 | ceph-common | |
270 | ${UNITTEST_LIBS} | |
271 | ${EXTRALIBS} | |
272 | ) | |
273 | ||
274 | # ceph_test_librgw_file_gp (just the rgw_file get-put bucket ops) | |
275 | add_executable(ceph_test_librgw_file_gp | |
276 | librgw_file_gp.cc | |
277 | ) | |
7c673cae FG |
278 | target_link_libraries(ceph_test_librgw_file_gp |
279 | rgw | |
280 | librados | |
281 | ceph-common | |
282 | ${UNITTEST_LIBS} | |
283 | ${EXTRALIBS} | |
284 | ) | |
285 | ||
286 | # ceph_test_librgw_file_nfsns (nfs namespace tests) | |
287 | add_executable(ceph_test_librgw_file_nfsns | |
288 | librgw_file_nfsns.cc | |
289 | ) | |
31f18b77 | 290 | if(WITH_RADOSGW_FCGI_FRONTEND) |
11fdf7f2 | 291 | target_include_directories(ceph_test_librgw_file_nfsns SYSTEM PRIVATE ${FCGI_INCLUDE_DIR}) |
31f18b77 | 292 | endif(WITH_RADOSGW_FCGI_FRONTEND) |
7c673cae FG |
293 | target_link_libraries(ceph_test_librgw_file_nfsns |
294 | rgw | |
295 | librados | |
296 | ceph-common | |
297 | ${UNITTEST_LIBS} | |
298 | ${EXTRALIBS} | |
299 | ) | |
300 | ||
301 | # ceph_test_librgw_file_aw (nfs write transaction [atomic write] tests) | |
302 | add_executable(ceph_test_librgw_file_aw | |
303 | librgw_file_aw.cc | |
304 | ) | |
7c673cae FG |
305 | target_link_libraries(ceph_test_librgw_file_aw |
306 | rgw | |
307 | librados | |
308 | ceph-common | |
309 | ${UNITTEST_LIBS} | |
310 | ${EXTRALIBS} | |
311 | ) | |
312 | ||
3efd9988 FG |
313 | # ceph_test_librgw_file_marker (READDIR with string and uint64 offsets) |
314 | add_executable(ceph_test_librgw_file_marker | |
315 | librgw_file_marker.cc | |
316 | ) | |
3efd9988 FG |
317 | target_link_libraries(ceph_test_librgw_file_marker |
318 | rgw | |
319 | librados | |
320 | ceph-common | |
321 | ${UNITTEST_LIBS} | |
322 | ${EXTRALIBS} | |
323 | ) | |
324 | ||
7c673cae FG |
325 | # ceph_test_rgw_token |
326 | add_executable(ceph_test_rgw_token | |
327 | test_rgw_token.cc | |
328 | ) | |
7c673cae FG |
329 | target_link_libraries(ceph_test_rgw_token |
330 | rgw | |
331 | os | |
332 | global | |
333 | ${UNITTEST_LIBS} | |
334 | ${EXTRALIBS} | |
335 | ) | |
336 | ||
337 | # librgw_file_gp (just the rgw_file get-put bucket ops) | |
338 | add_executable(test_rgw_ldap | |
339 | ${CMAKE_SOURCE_DIR}/src/rgw/rgw_ldap.cc | |
340 | test_rgw_ldap.cc | |
341 | ) | |
7c673cae FG |
342 | target_link_libraries(test_rgw_ldap |
343 | librados | |
344 | ceph-common | |
345 | ${OPENLDAP_LIBRARIES} | |
346 | ${UNITTEST_LIBS} | |
347 | ) | |
348 | ||
11fdf7f2 TL |
349 | # unittest_librgw_admin_user |
350 | add_executable(ceph_test_librgw_admin_user test_librgw_admin_user.cc) | |
351 | target_link_libraries(ceph_test_librgw_admin_user | |
352 | rgw_admin_user | |
353 | cls_otp_client | |
354 | librados | |
355 | ceph-common | |
356 | ${UNITTEST_LIBS} | |
357 | ${EXTRALIBS} | |
358 | ) | |
359 | ||
7c673cae FG |
360 | endif(${WITH_RADOSGW}) |
361 | ||
362 | # ceph_multi_stress_watch | |
363 | add_executable(ceph_multi_stress_watch | |
364 | multi_stress_watch.cc | |
365 | ) | |
11fdf7f2 | 366 | target_link_libraries(ceph_multi_stress_watch librados global radostest-cxx |
7c673cae FG |
367 | ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS}) |
368 | ||
369 | #ceph_perf_local | |
11fdf7f2 | 370 | add_executable(ceph_perf_local |
7c673cae FG |
371 | perf_local.cc |
372 | perf_helper.cc) | |
373 | if(HAVE_SSE) | |
374 | set(PERF_LOCAL_FLAGS ${SSE3_FLAGS}) | |
375 | endif(HAVE_SSE) | |
376 | if(HAVE_NEON) | |
377 | set(PERF_LOCAL_FLAGS ${ARM_NEON_FLAGS}) | |
378 | endif(HAVE_NEON) | |
379 | if(PERF_LOCAL_FLAGS) | |
380 | set_target_properties(ceph_perf_local PROPERTIES COMPILE_FLAGS | |
381 | ${PERF_LOCAL_FLAGS}) | |
382 | endif() | |
383 | target_link_libraries(ceph_perf_local os global ${UNITTEST_LIBS}) | |
384 | ||
7c673cae FG |
385 | install(TARGETS |
386 | ceph_bench_log | |
387 | ceph_multi_stress_watch | |
388 | ceph_objectstore_bench | |
389 | ceph_omapbench | |
390 | ceph_perf_local | |
7c673cae FG |
391 | DESTINATION bin) |
392 | ||
393 | # ceph_test_filejournal | |
394 | add_executable(ceph_test_filejournal | |
395 | test_filejournal.cc | |
396 | ) | |
7c673cae FG |
397 | target_link_libraries(ceph_test_filejournal |
398 | os | |
399 | ceph-common | |
400 | ${UNITTEST_LIBS} | |
401 | global | |
402 | ${EXTRALIBS} | |
403 | ${BLKID_LIBRARIES} | |
404 | ${CMAKE_DL_LIBS} | |
405 | ${EXTRALIBS} | |
406 | ) | |
407 | install(TARGETS | |
408 | ceph_test_filejournal | |
409 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
410 | ||
411 | # ceph_test_keys | |
412 | add_executable(ceph_test_keys | |
413 | testkeys.cc | |
414 | ) | |
415 | target_link_libraries(ceph_test_keys mon global ${CMAKE_DL_LIBS}) | |
416 | ||
417 | # ceph_test_snap_mapper | |
418 | add_executable(ceph_test_snap_mapper | |
419 | test_snap_mapper.cc | |
420 | $<TARGET_OBJECTS:unit-main> | |
421 | ) | |
422 | target_link_libraries(ceph_test_snap_mapper osd global ${BLKID_LIBRARIES} ${UNITTEST_LIBS}) | |
7c673cae FG |
423 | |
424 | add_executable(ceph_test_stress_watch | |
425 | test_stress_watch.cc | |
426 | ) | |
7c673cae FG |
427 | target_link_libraries(ceph_test_stress_watch |
428 | librados | |
429 | ${UNITTEST_LIBS} | |
11fdf7f2 | 430 | radostest-cxx |
7c673cae FG |
431 | ${EXTRALIBS} |
432 | ${BLKID_LIBRARIES} | |
433 | ${CMAKE_DL_LIBS} | |
434 | ) | |
435 | install(TARGETS | |
436 | ceph_test_stress_watch | |
437 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
438 | ||
439 | if(WITH_FUSE) | |
440 | add_executable(ceph_test_cfuse_cache_invalidate | |
441 | test_cfuse_cache_invalidate.cc | |
442 | ) | |
11fdf7f2 TL |
443 | target_link_libraries(ceph_test_cfuse_cache_invalidate |
444 | ceph-common | |
445 | ) | |
7c673cae FG |
446 | endif(WITH_FUSE) |
447 | ||
448 | if(${WITH_CEPHFS}) | |
449 | add_executable(test_c_headers | |
450 | test_c_headers.c | |
451 | ) | |
452 | target_link_libraries(test_c_headers | |
453 | librados | |
454 | cephfs) | |
455 | endif(${WITH_CEPHFS}) | |
456 | ||
11fdf7f2 TL |
457 | if(HAVE_BLKID OR FREEBSD) |
458 | add_executable(ceph_test_get_blkdev_props | |
459 | test_get_blkdev_props.cc | |
7c673cae | 460 | ) |
11fdf7f2 | 461 | target_link_libraries(ceph_test_get_blkdev_props |
7c673cae FG |
462 | ceph-common |
463 | pthread | |
464 | ${EXTRALIBS} | |
465 | ${BLKID_LIBRARIES} | |
466 | ${CMAKE_DL_LIBS} | |
467 | ) | |
11fdf7f2 | 468 | endif(HAVE_BLKID OR FREEBSD) |
7c673cae | 469 | |
31f18b77 FG |
470 | # ceph_test_admin_socket_output |
471 | ||
11fdf7f2 TL |
472 | find_package(StdFilesystem) |
473 | if(StdFilesystem_FOUND) | |
474 | add_executable(ceph_test_admin_socket_output | |
475 | test_admin_socket_output.cc | |
476 | admin_socket_output.cc | |
477 | admin_socket_output_tests.cc) | |
478 | target_link_libraries(ceph_test_admin_socket_output | |
479 | ceph-common StdFilesystem::filesystem) | |
480 | install(TARGETS | |
481 | ceph_test_admin_socket_output | |
482 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | |
483 | endif() | |
31f18b77 | 484 | |
7c673cae FG |
485 | #make check starts here |
486 | ||
487 | #following dependencies are run inside make check unit tests | |
488 | add_dependencies(tests | |
489 | ceph-mon | |
7c673cae FG |
490 | ceph-authtool |
491 | get_command_descriptions | |
492 | crushtool | |
493 | ceph-conf | |
494 | rados | |
7c673cae FG |
495 | monmaptool |
496 | ceph-osd | |
497 | ceph-dencoder | |
498 | ceph-objectstore-tool | |
11fdf7f2 | 499 | ceph-kvstore-tool |
7c673cae FG |
500 | ceph-monstore-tool |
501 | osdmaptool | |
502 | ceph_example | |
503 | ceph_snappy | |
504 | cls_lock | |
505 | ceph_test_objectstore | |
506 | ceph_erasure_code_non_regression | |
507 | ceph_erasure_code | |
11fdf7f2 TL |
508 | cython${PY_BINDING_INFIX}_modules) |
509 | if (WITH_CEPHFS) | |
510 | add_dependencies(tests ceph-mds) | |
511 | endif() | |
512 | if(WITH_MGR) | |
513 | add_dependencies(tests ceph-mgr) | |
514 | endif() | |
7c673cae FG |
515 | if(WITH_RBD) |
516 | add_dependencies(tests unittest_librbd rbd) | |
d2e6a577 FG |
517 | if(FREEBSD) |
518 | add_dependencies(tests rbd-ggate) | |
519 | endif(FREEBSD) | |
7c673cae FG |
520 | endif(WITH_RBD) |
521 | if(WITH_RADOSGW) | |
28e407b8 | 522 | add_dependencies(tests radosgw radosgw-admin) |
7c673cae | 523 | endif(WITH_RADOSGW) |
11fdf7f2 TL |
524 | #add dependency from fio just to ensure the plugin build isn't failing |
525 | if(WITH_FIO OR WITH_SYSTEM_FIO) | |
526 | add_dependencies(tests fio_ceph_objectstore) | |
527 | endif() | |
7c673cae | 528 | |
7c673cae FG |
529 | if(WITH_RBD) |
530 | add_ceph_test(run-rbd-unit-tests.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh) | |
d2e6a577 FG |
531 | if(FREEBSD) |
532 | add_ceph_test(rbd-ggate.sh ${CMAKE_CURRENT_SOURCE_DIR}/rbd-ggate.sh) | |
533 | endif(FREEBSD) | |
7c673cae FG |
534 | endif(WITH_RBD) |
535 | add_ceph_test(run-cli-tests ${CMAKE_CURRENT_SOURCE_DIR}/run-cli-tests) | |
536 | add_ceph_test(test_objectstore_memstore.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_objectstore_memstore.sh) | |
b5b8bbf5 | 537 | |
11fdf7f2 | 538 | # flaky |
b5b8bbf5 FG |
539 | #add_ceph_test(test_pidfile.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_pidfile.sh) |
540 | ||
c07f9fc5 | 541 | add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh) |
7c673cae | 542 | |
11fdf7f2 TL |
543 | # XXX are these safe to remove? they used to be around for ceph-disk tox testing |
544 | set(env_vars_for_tox_tests | |
7c673cae FG |
545 | CEPH_BUILD_DIR=${CMAKE_BINARY_DIR} |
546 | CEPH_ROOT=${CMAKE_SOURCE_DIR} | |
547 | CEPH_BIN=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} | |
548 | CEPH_LIB=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} | |
549 | CEPH_BUILD_VIRTUALENV=${CEPH_BUILD_VIRTUALENV} | |
7c673cae FG |
550 | LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib |
551 | PATH=$ENV{PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}:${CMAKE_SOURCE_DIR}/src | |
552 | PYTHONPATH=${CMAKE_SOURCE_DIR}/src/pybind | |
11fdf7f2 TL |
553 | WITH_PYTHON2=${WITH_PYTHON2} |
554 | WITH_PYTHON3=${WITH_PYTHON3}) | |
555 | ||
556 | if(WITH_MGR) | |
557 | add_test(NAME run-tox-mgr-dashboard COMMAND bash ${CMAKE_SOURCE_DIR}/src/pybind/mgr/dashboard/run-tox.sh) | |
558 | list(APPEND tox_tests run-tox-mgr-dashboard) | |
559 | set(MGR_DASHBOARD_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/mgr-dashboard-virtualenv) | |
560 | list(APPEND env_vars_for_tox_tests MGR_DASHBOARD_VIRTUALENV=${MGR_DASHBOARD_VIRTUALENV}) | |
561 | ||
562 | add_test(NAME run-tox-mgr-insights COMMAND bash ${CMAKE_SOURCE_DIR}/src/pybind/mgr/insights/run-tox.sh) | |
563 | list(APPEND tox_tests run-tox-mgr-insights) | |
564 | set(MGR_INSIGHTS_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/mgr-insights-virtualenv) | |
565 | list(APPEND env_vars_for_tox_tests MGR_INSIGHTS_VIRTUALENV=${MGR_INSIGHTS_VIRTUALENV}) | |
566 | ||
567 | add_test(NAME run-tox-mgr-ansible COMMAND bash ${CMAKE_SOURCE_DIR}/src/pybind/mgr/ansible/run-tox.sh) | |
568 | list(APPEND tox_tests run-tox-mgr-ansible) | |
569 | set(MGR_ANSIBLE_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/mgr-ansible-virtualenv) | |
570 | list(APPEND env_vars_for_tox_tests MGR_ANSIBLE_VIRTUALENV=${MGR_ANSIBLE_VIRTUALENV}) | |
571 | ||
572 | add_test(NAME run-tox-mgr-orchestrator_cli COMMAND bash ${CMAKE_SOURCE_DIR}/src/pybind/mgr/orchestrator_cli/run-tox.sh) | |
573 | list(APPEND tox_tests run-tox-mgr-orchestrator_cli) | |
574 | set(MGR_ORCHESTRATOR_CLI_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/mgr-orchestrator_cli-virtualenv) | |
575 | list(APPEND env_vars_for_tox_tests MGR_ORCHESTRATOR_CLI_VIRTUALENV=${MGR_ORCHESTRATOR_CLI_VIRTUALENV}) | |
576 | endif() | |
577 | ||
578 | set_property( | |
579 | TEST ${tox_tests} | |
580 | PROPERTY ENVIRONMENT ${env_vars_for_tox_tests}) | |
7c673cae FG |
581 | |
582 | # unittest_admin_socket | |
583 | add_executable(unittest_admin_socket | |
584 | admin_socket.cc | |
585 | $<TARGET_OBJECTS:unit-main> | |
586 | ) | |
11fdf7f2 TL |
587 | add_ceph_unittest(unittest_admin_socket) |
588 | target_link_libraries(unittest_admin_socket global) | |
7c673cae FG |
589 | |
590 | # unittest_encoding | |
591 | add_executable(unittest_encoding | |
592 | encoding.cc | |
593 | ) | |
11fdf7f2 TL |
594 | add_ceph_unittest(unittest_encoding) |
595 | target_link_libraries(unittest_encoding ceph-common) | |
7c673cae FG |
596 | |
597 | # unittest_addrs | |
598 | add_executable(unittest_addrs | |
599 | test_addrs.cc | |
600 | ) | |
11fdf7f2 TL |
601 | add_ceph_unittest(unittest_addrs) |
602 | target_link_libraries(unittest_addrs ceph-common) | |
603 | ||
604 | # unittest_auth | |
605 | add_executable(unittest_auth | |
606 | test_auth.cc | |
607 | $<TARGET_OBJECTS:unit-main> | |
608 | ) | |
609 | add_ceph_unittest(unittest_auth) | |
610 | target_link_libraries(unittest_auth global) | |
7c673cae FG |
611 | |
612 | # unittest_workqueue | |
613 | add_executable(unittest_workqueue | |
614 | test_workqueue.cc | |
615 | $<TARGET_OBJECTS:unit-main> | |
616 | ) | |
11fdf7f2 TL |
617 | add_ceph_unittest(unittest_workqueue) |
618 | target_link_libraries(unittest_workqueue global) | |
7c673cae FG |
619 | |
620 | # unittest_striper | |
11fdf7f2 TL |
621 | if(WITH_LIBRADOSSTRIPER) |
622 | add_executable(unittest_striper | |
623 | test_striper.cc | |
624 | $<TARGET_OBJECTS:unit-main> | |
625 | ) | |
626 | add_ceph_unittest(unittest_striper) | |
627 | target_link_libraries(unittest_striper global ${BLKID_LIBRARIES}) | |
628 | endif() | |
7c673cae FG |
629 | |
630 | # unittest_str_list | |
631 | add_executable(unittest_str_list | |
632 | test_str_list.cc | |
633 | ) | |
11fdf7f2 TL |
634 | add_ceph_unittest(unittest_str_list) |
635 | target_link_libraries(unittest_str_list global) | |
7c673cae FG |
636 | |
637 | # unittest_log | |
638 | add_executable(unittest_log | |
639 | ${CMAKE_SOURCE_DIR}/src/log/test.cc | |
640 | ) | |
11fdf7f2 | 641 | add_ceph_unittest(unittest_log) |
7c673cae FG |
642 | target_link_libraries(unittest_log global) |
643 | ||
644 | # unittest_base64 | |
645 | add_executable(unittest_base64 | |
646 | base64.cc | |
647 | ) | |
11fdf7f2 TL |
648 | add_ceph_unittest(unittest_base64) |
649 | target_link_libraries(unittest_base64 global) | |
7c673cae FG |
650 | |
651 | # unittest_ceph_argparse | |
652 | add_executable(unittest_ceph_argparse | |
653 | ceph_argparse.cc | |
654 | ) | |
11fdf7f2 | 655 | add_ceph_unittest(unittest_ceph_argparse) |
7c673cae FG |
656 | target_link_libraries(unittest_ceph_argparse global) |
657 | ||
658 | # unittest_ceph_compatset | |
659 | add_executable(unittest_ceph_compatset | |
660 | ceph_compatset.cc | |
661 | ) | |
11fdf7f2 | 662 | add_ceph_unittest(unittest_ceph_compatset) |
7c673cae FG |
663 | target_link_libraries(unittest_ceph_compatset global) |
664 | ||
665 | # unittest_gather | |
666 | add_executable(unittest_gather | |
667 | gather.cc | |
668 | $<TARGET_OBJECTS:unit-main> | |
669 | ) | |
11fdf7f2 | 670 | add_ceph_unittest(unittest_gather) |
7c673cae FG |
671 | target_link_libraries(unittest_gather global) |
672 | ||
673 | # unittest_run_cmd | |
674 | add_executable(unittest_run_cmd | |
675 | run_cmd.cc | |
676 | ) | |
11fdf7f2 | 677 | add_ceph_unittest(unittest_run_cmd) |
7c673cae FG |
678 | target_link_libraries(unittest_run_cmd global) |
679 | ||
680 | # signals | |
681 | add_executable(unittest_signals | |
682 | signals.cc | |
683 | $<TARGET_OBJECTS:unit-main> | |
684 | ) | |
11fdf7f2 | 685 | add_ceph_unittest(unittest_signals) |
7c673cae FG |
686 | target_link_libraries(unittest_signals global) |
687 | ||
688 | # unittest_simple_spin | |
689 | add_executable(unittest_simple_spin | |
690 | simple_spin.cc | |
691 | ) | |
11fdf7f2 | 692 | add_ceph_unittest(unittest_simple_spin) |
7c673cae FG |
693 | target_link_libraries(unittest_simple_spin global) |
694 | ||
695 | # unittest_bufferlist | |
696 | add_executable(unittest_bufferlist | |
697 | bufferlist.cc | |
11fdf7f2 | 698 | $<TARGET_OBJECTS:unit-main> |
7c673cae | 699 | ) |
11fdf7f2 | 700 | add_ceph_unittest(unittest_bufferlist) |
7c673cae FG |
701 | target_link_libraries(unittest_bufferlist global) |
702 | ||
703 | # unittest_xlist | |
704 | add_executable(unittest_xlist | |
705 | test_xlist.cc | |
706 | ) | |
11fdf7f2 TL |
707 | add_ceph_unittest(unittest_xlist) |
708 | target_link_libraries(unittest_xlist ceph-common) | |
7c673cae FG |
709 | |
710 | # unittest_arch | |
711 | add_executable(unittest_arch | |
712 | test_arch.cc | |
713 | $<TARGET_OBJECTS:unit-main> | |
714 | ) | |
11fdf7f2 | 715 | add_ceph_unittest(unittest_arch) |
7c673cae FG |
716 | target_link_libraries(unittest_arch global) |
717 | ||
718 | # unittest_denc | |
719 | add_executable(unittest_denc | |
720 | test_denc.cc | |
721 | ) | |
11fdf7f2 TL |
722 | add_ceph_unittest(unittest_denc) |
723 | target_link_libraries(unittest_denc global) | |
7c673cae FG |
724 | |
725 | # unittest_mempool | |
726 | add_executable(unittest_mempool | |
727 | test_mempool.cc | |
728 | ) | |
11fdf7f2 | 729 | add_ceph_unittest(unittest_mempool) |
7c673cae FG |
730 | target_link_libraries(unittest_mempool global) |
731 | ||
31f18b77 FG |
732 | # unittest_features |
733 | add_executable(unittest_features | |
734 | test_features.cc | |
735 | ) | |
11fdf7f2 | 736 | add_ceph_unittest(unittest_features) |
31f18b77 FG |
737 | target_link_libraries(unittest_features global) |
738 | ||
7c673cae FG |
739 | # unittest_crypto |
740 | add_executable(unittest_crypto | |
741 | crypto.cc | |
742 | $<TARGET_OBJECTS:unit-main> | |
743 | ) | |
11fdf7f2 | 744 | add_ceph_unittest(unittest_crypto) |
7c673cae FG |
745 | target_link_libraries(unittest_crypto global) |
746 | ||
747 | # unittest_crypto_init | |
748 | add_executable(unittest_crypto_init | |
749 | crypto_init.cc | |
750 | ) | |
11fdf7f2 | 751 | add_ceph_unittest(unittest_crypto_init) |
7c673cae FG |
752 | target_link_libraries(unittest_crypto_init global) |
753 | ||
754 | # unittest_perf_counters | |
755 | add_executable(unittest_perf_counters | |
756 | perf_counters.cc | |
757 | ) | |
11fdf7f2 | 758 | add_ceph_unittest(unittest_perf_counters) |
7c673cae FG |
759 | target_link_libraries(unittest_perf_counters global) |
760 | ||
761 | # unittest_ceph_crypto | |
762 | add_executable(unittest_ceph_crypto | |
763 | ceph_crypto.cc | |
764 | ) | |
11fdf7f2 | 765 | add_ceph_unittest(unittest_ceph_crypto) |
7c673cae FG |
766 | target_link_libraries(unittest_ceph_crypto global) |
767 | ||
768 | # unittest_utf8 | |
769 | add_executable(unittest_utf8 | |
770 | utf8.cc | |
771 | ) | |
11fdf7f2 | 772 | add_ceph_unittest(unittest_utf8) |
7c673cae FG |
773 | target_link_libraries(unittest_utf8 global) |
774 | ||
775 | # unittest_mime | |
776 | add_executable(unittest_mime | |
777 | mime.cc | |
778 | ) | |
11fdf7f2 | 779 | add_ceph_unittest(unittest_mime) |
7c673cae FG |
780 | target_link_libraries(unittest_mime global) |
781 | ||
782 | # unittest_escape | |
783 | add_executable(unittest_escape | |
784 | escape.cc | |
785 | ) | |
11fdf7f2 | 786 | add_ceph_unittest(unittest_escape) |
7c673cae FG |
787 | target_link_libraries(unittest_escape global) |
788 | ||
789 | # unittest_strtol | |
790 | add_executable(unittest_strtol | |
791 | strtol.cc | |
792 | ) | |
11fdf7f2 | 793 | add_ceph_unittest(unittest_strtol) |
7c673cae FG |
794 | target_link_libraries(unittest_strtol global) |
795 | ||
796 | # unittest_confutils | |
797 | add_executable(unittest_confutils | |
798 | confutils.cc | |
799 | ) | |
11fdf7f2 | 800 | add_ceph_unittest(unittest_confutils) |
7c673cae FG |
801 | target_link_libraries(unittest_confutils global) |
802 | ||
803 | # unittest_heartbeatmap | |
804 | add_executable(unittest_heartbeatmap | |
805 | heartbeat_map.cc | |
806 | $<TARGET_OBJECTS:unit-main> | |
807 | ) | |
11fdf7f2 | 808 | add_ceph_unittest(unittest_heartbeatmap) |
7c673cae FG |
809 | target_link_libraries(unittest_heartbeatmap global ceph-common) |
810 | ||
811 | if(${WITH_RADOSGW}) | |
812 | # unittest_formatter | |
813 | add_executable(unittest_formatter | |
814 | formatter.cc | |
815 | $<TARGET_OBJECTS:unit-main> | |
816 | ) | |
11fdf7f2 | 817 | add_ceph_unittest(unittest_formatter) |
7c673cae FG |
818 | target_link_libraries(unittest_formatter global) |
819 | endif(${WITH_RADOSGW}) | |
820 | ||
821 | # unittest_daemon_config | |
822 | add_executable(unittest_daemon_config | |
823 | daemon_config.cc | |
824 | $<TARGET_OBJECTS:unit-main> | |
825 | ) | |
11fdf7f2 | 826 | add_ceph_unittest(unittest_daemon_config) |
7c673cae FG |
827 | target_link_libraries(unittest_daemon_config |
828 | ceph-common | |
829 | global | |
830 | ${BLKID_LIBRARIES} | |
831 | ${EXTRALIBS} | |
832 | ) | |
833 | ||
834 | if(WITH_LIBCEPHFS) | |
835 | # unittest_libcephfs_config | |
836 | add_executable(unittest_libcephfs_config | |
837 | libcephfs_config.cc | |
838 | ) | |
11fdf7f2 | 839 | add_ceph_unittest(unittest_libcephfs_config) |
7c673cae FG |
840 | target_link_libraries(unittest_libcephfs_config cephfs) |
841 | endif(WITH_LIBCEPHFS) | |
842 | ||
843 | if(WITH_RBD) | |
844 | # unittest_rbd_replay | |
845 | add_executable(unittest_rbd_replay | |
846 | test_rbd_replay.cc) | |
11fdf7f2 | 847 | add_ceph_unittest(unittest_rbd_replay) |
7c673cae FG |
848 | target_link_libraries(unittest_rbd_replay |
849 | librbd | |
850 | librados | |
851 | global | |
852 | rbd_replay | |
853 | rbd_replay_ios | |
854 | ${BLKID_LIBRARIES} | |
855 | ) | |
856 | endif(WITH_RBD) | |
857 | ||
858 | # unittest_ipaddr | |
859 | add_executable(unittest_ipaddr | |
11fdf7f2 TL |
860 | test_ipaddr.cc) |
861 | add_ceph_unittest(unittest_ipaddr) | |
7c673cae FG |
862 | target_link_libraries(unittest_ipaddr mon global) |
863 | ||
864 | # unittest_texttable | |
865 | add_executable(unittest_texttable | |
866 | test_texttable.cc | |
867 | $<TARGET_OBJECTS:common_texttable_obj> | |
868 | ) | |
11fdf7f2 | 869 | add_ceph_unittest(unittest_texttable) |
7c673cae FG |
870 | target_link_libraries(unittest_texttable mon global) |
871 | ||
872 | # unittest_on_exit | |
873 | add_executable(unittest_on_exit | |
874 | on_exit.cc | |
875 | ) | |
11fdf7f2 | 876 | add_ceph_unittest(unittest_on_exit) |
7c673cae FG |
877 | target_link_libraries(unittest_on_exit global) |
878 | ||
879 | # unittest_subprocess | |
880 | add_executable(unittest_subprocess | |
881 | test_subprocess.cc | |
882 | ) | |
11fdf7f2 | 883 | add_ceph_unittest(unittest_subprocess) |
7c673cae FG |
884 | target_link_libraries(unittest_subprocess global) |
885 | ||
886 | # unittest_pageset | |
887 | add_executable(unittest_pageset test_pageset.cc) | |
11fdf7f2 | 888 | add_ceph_unittest(unittest_pageset) |
7c673cae FG |
889 | target_link_libraries(unittest_pageset global) |
890 | ||
11fdf7f2 TL |
891 | # unittest_any_ |
892 | add_executable(unittest_any test_any.cc) | |
893 | add_ceph_unittest(unittest_any) | |
894 | target_link_libraries(unittest_any) | |
7c673cae | 895 | |
11fdf7f2 | 896 | #make check ends here |