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