]> git.proxmox.com Git - ceph.git/blame - ceph/src/test/CMakeLists.txt
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / test / CMakeLists.txt
CommitLineData
7c673cae
FG
1include(AddCephTest)
2
11fdf7f2
TL
3set(UNITTEST_LIBS GMock::Main GMock::GMock GTest::GTest ${CMAKE_THREAD_LIBS_INIT}
4 ${GSSAPI_LIBRARIES} ${OPENLDAP_LIBRARIES} ${CMAKE_DL_LIBS})
7c673cae
FG
5
6add_library(unit-main OBJECT unit.cc)
11fdf7f2
TL
7target_include_directories(unit-main PRIVATE
8 $<TARGET_PROPERTY:GTest::GTest,INTERFACE_INCLUDE_DIRECTORIES>)
7c673cae 9
7c673cae
FG
10add_subdirectory(cls_hello)
11add_subdirectory(cls_lock)
12add_subdirectory(cls_log)
13add_subdirectory(cls_numops)
14add_subdirectory(cls_sdk)
15if(WITH_RBD)
3efd9988 16 add_subdirectory(cls_journal)
7c673cae
FG
17 add_subdirectory(cls_rbd)
18endif(WITH_RBD)
19add_subdirectory(cls_refcount)
7c673cae 20add_subdirectory(cls_rgw)
7c673cae
FG
21add_subdirectory(cls_version)
22add_subdirectory(cls_lua)
23add_subdirectory(common)
24add_subdirectory(compressor)
25add_subdirectory(crush)
26add_subdirectory(direct_messenger)
27add_subdirectory(encoding)
28add_subdirectory(erasure-code)
29add_subdirectory(filestore)
30add_subdirectory(fs)
31add_subdirectory(journal)
7c673cae
FG
32add_subdirectory(libcephfs)
33add_subdirectory(librados)
34add_subdirectory(librados_test_stub)
11fdf7f2
TL
35if(WITH_LIBRADOSSTRIPER)
36 add_subdirectory(libradosstriper)
37endif()
7c673cae
FG
38if(WITH_RBD)
39 add_subdirectory(librbd)
40endif(WITH_RBD)
41add_subdirectory(messenger)
11fdf7f2
TL
42if (WITH_CEPHFS)
43 add_subdirectory(mds)
44endif()
7c673cae 45add_subdirectory(mon)
31f18b77 46add_subdirectory(mgr)
7c673cae
FG
47add_subdirectory(msgr)
48add_subdirectory(ObjectMap)
49add_subdirectory(objectstore)
50add_subdirectory(os)
51add_subdirectory(osd)
52add_subdirectory(osdc)
53add_subdirectory(pybind)
11fdf7f2
TL
54if(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 60endif(WITH_RADOSGW)
7c673cae
FG
61if(WITH_RBD)
62 add_subdirectory(rbd_mirror)
63endif(WITH_RBD)
11fdf7f2
TL
64if(WITH_SEASTAR)
65 add_subdirectory(crimson)
66endif()
7c673cae 67add_subdirectory(system)
11fdf7f2 68if(WITH_FIO OR WITH_SYSTEM_FIO)
7c673cae
FG
69 add_subdirectory(fio)
70endif()
71
72# test_timers
73add_executable(ceph_test_timers
74 TestTimers.cc
75 )
76target_link_libraries(ceph_test_timers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
77
78# test_signal_handlers
79add_executable(ceph_test_signal_handlers
80 TestSignalHandlers.cc
81 )
82target_link_libraries(ceph_test_signal_handlers global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
83
84# test_rewrite_latency
85add_executable(ceph_test_rewrite_latency
86 test_rewrite_latency.cc
87 )
88target_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
93add_executable(test_crypto
94 testcrypto.cc
95 )
96target_link_libraries(test_crypto
97 global
98 ${CRYPTO_LIBS}
99 m
100 ${EXTRALIBS}
101 ${BLKID_LIBRARIES}
102 ${CMAKE_DL_LIBS}
103 )
104
105add_executable(test_build_libcommon buildtest_skeleton.cc)
106target_link_libraries(test_build_libcommon ceph-common pthread ${CRYPTO_LIBS} ${EXTRALIBS})
107
108if(WITH_RADOSGW)
109 add_executable(test_build_librgw buildtest_skeleton.cc)
110 target_link_libraries(test_build_librgw rgw_a pthread ${CRYPTO_LIBS} ${EXTRALIBS})
111endif(WITH_RADOSGW)
112
11fdf7f2
TL
113if(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})
116endif(WITH_RADOSGW)
117
7c673cae
FG
118if(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})
122endif(WITH_LIBCEPHFS)
123
124add_executable(test_build_librados buildtest_skeleton.cc)
125target_link_libraries(test_build_librados librados pthread ${CRYPTO_LIBS} ${EXTRALIBS} osdc osd os ceph-common cls_lock_client ${BLKID_LIBRARIES})
126
127# bench_log
128set(bench_log_srcs
129 bench_log.cc
130 )
131add_executable(ceph_bench_log
132 ${bench_log_srcs}
133 )
134target_link_libraries(ceph_bench_log global pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
135
136# ceph_test_mutate
137add_executable(ceph_test_mutate
138 test_mutate.cc
139 )
140target_link_libraries(ceph_test_mutate global librados ${BLKID_LIBRARIES}
141 ${CMAKE_DL_LIBS})
142
143# test_trans
144add_executable(test_trans
145 test_trans.cc
146 )
147target_link_libraries(test_trans os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
148
149## Benchmarks
150
151
152# ceph_omapbench
153set(omapbench_srcs
154 omap_bench.cc
155 )
156add_executable(ceph_omapbench
157 ${omapbench_srcs}
158 )
159target_link_libraries(ceph_omapbench
160 librados
31f18b77 161 Boost::program_options
7c673cae
FG
162 global
163 ${BLKID_LIBRARIES}
164 ${CMAKE_DL_LIBS}
165 )
166
167if(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)
176endif(WITH_KVS)
177
178# ceph_objectstore_bench
179add_executable(ceph_objectstore_bench objectstore_bench.cc)
180target_link_libraries(ceph_objectstore_bench os global ${BLKID_LIBRARIES})
181
182if(${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)
248add_executable(ceph_test_librgw_file
249 librgw_file.cc
250 )
31f18b77 251if(WITH_RADOSGW_FCGI_FRONTEND)
11fdf7f2 252target_include_directories(ceph_test_librgw_file SYSTEM PRIVATE ${FCGI_INCLUDE_DIR})
31f18b77 253endif(WITH_RADOSGW_FCGI_FRONTEND)
7c673cae
FG
254target_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)
263add_executable(ceph_test_librgw_file_cd
264 librgw_file_cd.cc
265 )
7c673cae
FG
266target_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)
275add_executable(ceph_test_librgw_file_gp
276 librgw_file_gp.cc
277 )
7c673cae
FG
278target_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)
287add_executable(ceph_test_librgw_file_nfsns
288 librgw_file_nfsns.cc
289 )
31f18b77 290if(WITH_RADOSGW_FCGI_FRONTEND)
11fdf7f2 291target_include_directories(ceph_test_librgw_file_nfsns SYSTEM PRIVATE ${FCGI_INCLUDE_DIR})
31f18b77 292endif(WITH_RADOSGW_FCGI_FRONTEND)
7c673cae
FG
293target_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)
302add_executable(ceph_test_librgw_file_aw
303 librgw_file_aw.cc
304 )
7c673cae
FG
305target_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)
314add_executable(ceph_test_librgw_file_marker
315 librgw_file_marker.cc
316 )
3efd9988
FG
317target_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
326add_executable(ceph_test_rgw_token
327 test_rgw_token.cc
328 )
7c673cae
FG
329target_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)
338add_executable(test_rgw_ldap
339 ${CMAKE_SOURCE_DIR}/src/rgw/rgw_ldap.cc
340 test_rgw_ldap.cc
341 )
7c673cae
FG
342target_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
350add_executable(ceph_test_librgw_admin_user test_librgw_admin_user.cc)
351target_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
360endif(${WITH_RADOSGW})
361
362# ceph_multi_stress_watch
363add_executable(ceph_multi_stress_watch
364 multi_stress_watch.cc
365 )
11fdf7f2 366target_link_libraries(ceph_multi_stress_watch librados global radostest-cxx
7c673cae
FG
367 ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
368
369#ceph_perf_local
11fdf7f2 370add_executable(ceph_perf_local
7c673cae
FG
371 perf_local.cc
372 perf_helper.cc)
373if(HAVE_SSE)
374 set(PERF_LOCAL_FLAGS ${SSE3_FLAGS})
375endif(HAVE_SSE)
376if(HAVE_NEON)
377 set(PERF_LOCAL_FLAGS ${ARM_NEON_FLAGS})
378endif(HAVE_NEON)
379if(PERF_LOCAL_FLAGS)
380 set_target_properties(ceph_perf_local PROPERTIES COMPILE_FLAGS
381 ${PERF_LOCAL_FLAGS})
382endif()
383target_link_libraries(ceph_perf_local os global ${UNITTEST_LIBS})
384
7c673cae
FG
385install(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
394add_executable(ceph_test_filejournal
395 test_filejournal.cc
396 )
7c673cae
FG
397target_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 )
407install(TARGETS
408 ceph_test_filejournal
409 DESTINATION ${CMAKE_INSTALL_BINDIR})
410
411# ceph_test_keys
412add_executable(ceph_test_keys
413 testkeys.cc
414 )
415target_link_libraries(ceph_test_keys mon global ${CMAKE_DL_LIBS})
416
417# ceph_test_snap_mapper
418add_executable(ceph_test_snap_mapper
419 test_snap_mapper.cc
420 $<TARGET_OBJECTS:unit-main>
421 )
422target_link_libraries(ceph_test_snap_mapper osd global ${BLKID_LIBRARIES} ${UNITTEST_LIBS})
7c673cae
FG
423
424add_executable(ceph_test_stress_watch
425 test_stress_watch.cc
426 )
7c673cae
FG
427target_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 )
435install(TARGETS
436 ceph_test_stress_watch
437 DESTINATION ${CMAKE_INSTALL_BINDIR})
438
439if(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
446endif(WITH_FUSE)
447
448if(${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)
455endif(${WITH_CEPHFS})
456
11fdf7f2
TL
457if(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 468endif(HAVE_BLKID OR FREEBSD)
7c673cae 469
31f18b77
FG
470# ceph_test_admin_socket_output
471
11fdf7f2
TL
472find_package(StdFilesystem)
473if(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})
483endif()
31f18b77 484
7c673cae
FG
485#make check starts here
486
487#following dependencies are run inside make check unit tests
488add_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)
509if (WITH_CEPHFS)
510 add_dependencies(tests ceph-mds)
511endif()
512if(WITH_MGR)
513 add_dependencies(tests ceph-mgr)
514endif()
7c673cae
FG
515if(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
520endif(WITH_RBD)
521if(WITH_RADOSGW)
28e407b8 522 add_dependencies(tests radosgw radosgw-admin)
7c673cae 523endif(WITH_RADOSGW)
11fdf7f2
TL
524#add dependency from fio just to ensure the plugin build isn't failing
525if(WITH_FIO OR WITH_SYSTEM_FIO)
526 add_dependencies(tests fio_ceph_objectstore)
527endif()
7c673cae 528
7c673cae
FG
529if(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
534endif(WITH_RBD)
535add_ceph_test(run-cli-tests ${CMAKE_CURRENT_SOURCE_DIR}/run-cli-tests)
536add_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 541add_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
544set(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
556if(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})
576endif()
577
578set_property(
579 TEST ${tox_tests}
580 PROPERTY ENVIRONMENT ${env_vars_for_tox_tests})
7c673cae
FG
581
582# unittest_admin_socket
583add_executable(unittest_admin_socket
584 admin_socket.cc
585 $<TARGET_OBJECTS:unit-main>
586 )
11fdf7f2
TL
587add_ceph_unittest(unittest_admin_socket)
588target_link_libraries(unittest_admin_socket global)
7c673cae
FG
589
590# unittest_encoding
591add_executable(unittest_encoding
592 encoding.cc
593 )
11fdf7f2
TL
594add_ceph_unittest(unittest_encoding)
595target_link_libraries(unittest_encoding ceph-common)
7c673cae
FG
596
597# unittest_addrs
598add_executable(unittest_addrs
599 test_addrs.cc
600 )
11fdf7f2
TL
601add_ceph_unittest(unittest_addrs)
602target_link_libraries(unittest_addrs ceph-common)
603
604# unittest_auth
605add_executable(unittest_auth
606 test_auth.cc
607 $<TARGET_OBJECTS:unit-main>
608 )
609add_ceph_unittest(unittest_auth)
610target_link_libraries(unittest_auth global)
7c673cae
FG
611
612# unittest_workqueue
613add_executable(unittest_workqueue
614 test_workqueue.cc
615 $<TARGET_OBJECTS:unit-main>
616 )
11fdf7f2
TL
617add_ceph_unittest(unittest_workqueue)
618target_link_libraries(unittest_workqueue global)
7c673cae
FG
619
620# unittest_striper
11fdf7f2
TL
621if(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})
628endif()
7c673cae
FG
629
630# unittest_str_list
631add_executable(unittest_str_list
632 test_str_list.cc
633 )
11fdf7f2
TL
634add_ceph_unittest(unittest_str_list)
635target_link_libraries(unittest_str_list global)
7c673cae
FG
636
637# unittest_log
638add_executable(unittest_log
639 ${CMAKE_SOURCE_DIR}/src/log/test.cc
640 )
11fdf7f2 641add_ceph_unittest(unittest_log)
7c673cae
FG
642target_link_libraries(unittest_log global)
643
644# unittest_base64
645add_executable(unittest_base64
646 base64.cc
647 )
11fdf7f2
TL
648add_ceph_unittest(unittest_base64)
649target_link_libraries(unittest_base64 global)
7c673cae
FG
650
651# unittest_ceph_argparse
652add_executable(unittest_ceph_argparse
653 ceph_argparse.cc
654 )
11fdf7f2 655add_ceph_unittest(unittest_ceph_argparse)
7c673cae
FG
656target_link_libraries(unittest_ceph_argparse global)
657
658# unittest_ceph_compatset
659add_executable(unittest_ceph_compatset
660 ceph_compatset.cc
661 )
11fdf7f2 662add_ceph_unittest(unittest_ceph_compatset)
7c673cae
FG
663target_link_libraries(unittest_ceph_compatset global)
664
665# unittest_gather
666add_executable(unittest_gather
667 gather.cc
668 $<TARGET_OBJECTS:unit-main>
669 )
11fdf7f2 670add_ceph_unittest(unittest_gather)
7c673cae
FG
671target_link_libraries(unittest_gather global)
672
673# unittest_run_cmd
674add_executable(unittest_run_cmd
675 run_cmd.cc
676 )
11fdf7f2 677add_ceph_unittest(unittest_run_cmd)
7c673cae
FG
678target_link_libraries(unittest_run_cmd global)
679
680# signals
681add_executable(unittest_signals
682 signals.cc
683 $<TARGET_OBJECTS:unit-main>
684 )
11fdf7f2 685add_ceph_unittest(unittest_signals)
7c673cae
FG
686target_link_libraries(unittest_signals global)
687
688# unittest_simple_spin
689add_executable(unittest_simple_spin
690 simple_spin.cc
691 )
11fdf7f2 692add_ceph_unittest(unittest_simple_spin)
7c673cae
FG
693target_link_libraries(unittest_simple_spin global)
694
695# unittest_bufferlist
696add_executable(unittest_bufferlist
697 bufferlist.cc
11fdf7f2 698 $<TARGET_OBJECTS:unit-main>
7c673cae 699 )
11fdf7f2 700add_ceph_unittest(unittest_bufferlist)
7c673cae
FG
701target_link_libraries(unittest_bufferlist global)
702
703# unittest_xlist
704add_executable(unittest_xlist
705 test_xlist.cc
706 )
11fdf7f2
TL
707add_ceph_unittest(unittest_xlist)
708target_link_libraries(unittest_xlist ceph-common)
7c673cae
FG
709
710# unittest_arch
711add_executable(unittest_arch
712 test_arch.cc
713 $<TARGET_OBJECTS:unit-main>
714 )
11fdf7f2 715add_ceph_unittest(unittest_arch)
7c673cae
FG
716target_link_libraries(unittest_arch global)
717
718# unittest_denc
719add_executable(unittest_denc
720 test_denc.cc
721 )
11fdf7f2
TL
722add_ceph_unittest(unittest_denc)
723target_link_libraries(unittest_denc global)
7c673cae
FG
724
725# unittest_mempool
726add_executable(unittest_mempool
727 test_mempool.cc
728 )
11fdf7f2 729add_ceph_unittest(unittest_mempool)
7c673cae
FG
730target_link_libraries(unittest_mempool global)
731
31f18b77
FG
732# unittest_features
733add_executable(unittest_features
734 test_features.cc
735 )
11fdf7f2 736add_ceph_unittest(unittest_features)
31f18b77
FG
737target_link_libraries(unittest_features global)
738
7c673cae
FG
739# unittest_crypto
740add_executable(unittest_crypto
741 crypto.cc
742 $<TARGET_OBJECTS:unit-main>
743 )
11fdf7f2 744add_ceph_unittest(unittest_crypto)
7c673cae
FG
745target_link_libraries(unittest_crypto global)
746
747# unittest_crypto_init
748add_executable(unittest_crypto_init
749 crypto_init.cc
750 )
11fdf7f2 751add_ceph_unittest(unittest_crypto_init)
7c673cae
FG
752target_link_libraries(unittest_crypto_init global)
753
754# unittest_perf_counters
755add_executable(unittest_perf_counters
756 perf_counters.cc
757 )
11fdf7f2 758add_ceph_unittest(unittest_perf_counters)
7c673cae
FG
759target_link_libraries(unittest_perf_counters global)
760
761# unittest_ceph_crypto
762add_executable(unittest_ceph_crypto
763 ceph_crypto.cc
764 )
11fdf7f2 765add_ceph_unittest(unittest_ceph_crypto)
7c673cae
FG
766target_link_libraries(unittest_ceph_crypto global)
767
768# unittest_utf8
769add_executable(unittest_utf8
770 utf8.cc
771 )
11fdf7f2 772add_ceph_unittest(unittest_utf8)
7c673cae
FG
773target_link_libraries(unittest_utf8 global)
774
775# unittest_mime
776add_executable(unittest_mime
777 mime.cc
778 )
11fdf7f2 779add_ceph_unittest(unittest_mime)
7c673cae
FG
780target_link_libraries(unittest_mime global)
781
782# unittest_escape
783add_executable(unittest_escape
784 escape.cc
785 )
11fdf7f2 786add_ceph_unittest(unittest_escape)
7c673cae
FG
787target_link_libraries(unittest_escape global)
788
789# unittest_strtol
790add_executable(unittest_strtol
791 strtol.cc
792 )
11fdf7f2 793add_ceph_unittest(unittest_strtol)
7c673cae
FG
794target_link_libraries(unittest_strtol global)
795
796# unittest_confutils
797add_executable(unittest_confutils
798 confutils.cc
799 )
11fdf7f2 800add_ceph_unittest(unittest_confutils)
7c673cae
FG
801target_link_libraries(unittest_confutils global)
802
803# unittest_heartbeatmap
804add_executable(unittest_heartbeatmap
805 heartbeat_map.cc
806 $<TARGET_OBJECTS:unit-main>
807 )
11fdf7f2 808add_ceph_unittest(unittest_heartbeatmap)
7c673cae
FG
809target_link_libraries(unittest_heartbeatmap global ceph-common)
810
811if(${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)
819endif(${WITH_RADOSGW})
820
821# unittest_daemon_config
822add_executable(unittest_daemon_config
823 daemon_config.cc
824 $<TARGET_OBJECTS:unit-main>
825 )
11fdf7f2 826add_ceph_unittest(unittest_daemon_config)
7c673cae
FG
827target_link_libraries(unittest_daemon_config
828 ceph-common
829 global
830 ${BLKID_LIBRARIES}
831 ${EXTRALIBS}
832 )
833
834if(WITH_LIBCEPHFS)
835# unittest_libcephfs_config
836add_executable(unittest_libcephfs_config
837 libcephfs_config.cc
838 )
11fdf7f2 839add_ceph_unittest(unittest_libcephfs_config)
7c673cae
FG
840target_link_libraries(unittest_libcephfs_config cephfs)
841endif(WITH_LIBCEPHFS)
842
843if(WITH_RBD)
844# unittest_rbd_replay
845add_executable(unittest_rbd_replay
846 test_rbd_replay.cc)
11fdf7f2 847add_ceph_unittest(unittest_rbd_replay)
7c673cae
FG
848target_link_libraries(unittest_rbd_replay
849 librbd
850 librados
851 global
852 rbd_replay
853 rbd_replay_ios
854 ${BLKID_LIBRARIES}
855 )
856endif(WITH_RBD)
857
858# unittest_ipaddr
859add_executable(unittest_ipaddr
11fdf7f2
TL
860 test_ipaddr.cc)
861add_ceph_unittest(unittest_ipaddr)
7c673cae
FG
862target_link_libraries(unittest_ipaddr mon global)
863
864# unittest_texttable
865add_executable(unittest_texttable
866 test_texttable.cc
867 $<TARGET_OBJECTS:common_texttable_obj>
868 )
11fdf7f2 869add_ceph_unittest(unittest_texttable)
7c673cae
FG
870target_link_libraries(unittest_texttable mon global)
871
872# unittest_on_exit
873add_executable(unittest_on_exit
874 on_exit.cc
875 )
11fdf7f2 876add_ceph_unittest(unittest_on_exit)
7c673cae
FG
877target_link_libraries(unittest_on_exit global)
878
879# unittest_subprocess
880add_executable(unittest_subprocess
881 test_subprocess.cc
882 )
11fdf7f2 883add_ceph_unittest(unittest_subprocess)
7c673cae
FG
884target_link_libraries(unittest_subprocess global)
885
886# unittest_pageset
887add_executable(unittest_pageset test_pageset.cc)
11fdf7f2 888add_ceph_unittest(unittest_pageset)
7c673cae
FG
889target_link_libraries(unittest_pageset global)
890
11fdf7f2
TL
891# unittest_any_
892add_executable(unittest_any test_any.cc)
893add_ceph_unittest(unittest_any)
894target_link_libraries(unittest_any)
7c673cae 895
11fdf7f2 896#make check ends here