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