]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/test/CMakeLists.txt
Import ceph 15.2.8
[ceph.git] / ceph / src / test / CMakeLists.txt
index 66e24b8bc96d0fb6df1e8b2b74cc756f4e5b028a..0b7164e91ef8cdff0c300ed36d6fa02a37f65410 100644 (file)
@@ -1,13 +1,12 @@
 include(AddCephTest)
 
-set(UNITTEST_LIBS gmock_main gmock gtest ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
-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")
+set(UNITTEST_LIBS GMock::Main GMock::GMock GTest::GTest ${CMAKE_THREAD_LIBS_INIT} 
+    ${GSSAPI_LIBRARIES} ${OPENLDAP_LIBRARIES} ${CMAKE_DL_LIBS})
 
 add_library(unit-main OBJECT unit.cc)
-set_source_files_properties(unit.cc PROPERTIES
-  COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
+target_include_directories(unit-main PRIVATE
+  $<TARGET_PROPERTY:GTest::GTest,INTERFACE_INCLUDE_DIRECTORIES>)
 
-add_subdirectory(bench)
 add_subdirectory(cls_hello)
 add_subdirectory(cls_lock)
 add_subdirectory(cls_log)
@@ -18,11 +17,11 @@ if(WITH_RBD)
   add_subdirectory(cls_rbd)
 endif(WITH_RBD)
 add_subdirectory(cls_refcount)
-add_subdirectory(cls_replica_log)
 add_subdirectory(cls_rgw)
-add_subdirectory(cls_statelog)
 add_subdirectory(cls_version)
 add_subdirectory(cls_lua)
+add_subdirectory(cls_rgw_gc)
+add_subdirectory(cls_queue)
 add_subdirectory(common)
 add_subdirectory(compressor)
 add_subdirectory(crush)
@@ -35,12 +34,15 @@ add_subdirectory(journal)
 add_subdirectory(libcephfs)
 add_subdirectory(librados)
 add_subdirectory(librados_test_stub)
-add_subdirectory(libradosstriper)
+if(WITH_LIBRADOSSTRIPER)
+  add_subdirectory(libradosstriper)
+endif()
 if(WITH_RBD)
   add_subdirectory(librbd)
 endif(WITH_RBD)
-add_subdirectory(messenger)
-add_subdirectory(mds)
+if (WITH_CEPHFS)
+  add_subdirectory(mds)
+endif()
 add_subdirectory(mon)
 add_subdirectory(mgr)
 add_subdirectory(msgr)
@@ -50,16 +52,28 @@ add_subdirectory(os)
 add_subdirectory(osd)
 add_subdirectory(osdc)
 add_subdirectory(pybind)
-if(${WITH_RADOSGW})
+add_subdirectory(immutable_object_cache)
+if(WITH_RADOSGW)
+  set(rgw_libs rgw_a)
+  if(WITH_RADOSGW_AMQP_ENDPOINT)
+    list(APPEND rgw_libs amqp_mock)
+  endif()
+  if(WITH_RADOSGW_KAFKA_ENDPOINT)
+    list(APPEND rgw_libs kafka_stub)
+  endif()
   add_subdirectory(rgw)
-endif(${WITH_RADOSGW})
+endif(WITH_RADOSGW)
 if(WITH_RBD)
   add_subdirectory(rbd_mirror)
 endif(WITH_RBD)
+if(WITH_SEASTAR)
+  add_subdirectory(crimson)
+endif()
 add_subdirectory(system)
-if(WITH_FIO)
+if(WITH_FIO OR WITH_SYSTEM_FIO)
   add_subdirectory(fio)
 endif()
+add_subdirectory(lazy-omap-stats)
 
 # test_timers
 add_executable(ceph_test_timers
@@ -77,22 +91,13 @@ target_link_libraries(ceph_test_signal_handlers global ${BLKID_LIBRARIES} ${CMAK
 add_executable(ceph_test_rewrite_latency
   test_rewrite_latency.cc
   )
-target_link_libraries(ceph_test_rewrite_latency ceph-common
-  ${CMAKE_DL_LIBS}
-  ${CMAKE_THREAD_LIBS_INIT} ${CRYPTO_LIBS} m ${EXTRALIBS})
+target_link_libraries(ceph_test_rewrite_latency ceph-common)
 
 # test_crypt
 add_executable(test_crypto
-  testcrypto.cc
-  )
+  testcrypto.cc)
 target_link_libraries(test_crypto
-  global
-  ${CRYPTO_LIBS}
-  m
-  ${EXTRALIBS}
-  ${BLKID_LIBRARIES}
-  ${CMAKE_DL_LIBS}
-  )
+  ceph-common)
 
 add_executable(test_build_libcommon buildtest_skeleton.cc)
 target_link_libraries(test_build_libcommon ceph-common pthread ${CRYPTO_LIBS} ${EXTRALIBS})
@@ -145,11 +150,8 @@ add_executable(ceph_omapbench
   )
 target_link_libraries(ceph_omapbench
   librados
-  Boost::program_options
-  global
-  ${BLKID_LIBRARIES}
-  ${CMAKE_DL_LIBS}
-  )
+  ceph-common
+  Boost::program_options)
 
 if(WITH_KVS)
   # ceph_kvstorebench
@@ -174,14 +176,12 @@ if(${WITH_RADOSGW})
     )
   target_link_libraries(test_cors
     librados
-    rgw_a
+    ${rgw_libs}
     global
     ${BLKID_LIBRARIES}
     ${CURL_LIBRARIES}
     ${EXPAT_LIBRARIES}
     ${CMAKE_DL_LIBS} ${UNITTEST_LIBS})
-  set_target_properties(test_cors PROPERTIES COMPILE_FLAGS
-    ${UNITTEST_CXX_FLAGS})
 
   # ceph_test_cls_rgw_meta
   set(test_cls_rgw_meta_srcs test_rgw_admin_meta.cc)
@@ -190,22 +190,18 @@ if(${WITH_RADOSGW})
     )
   target_link_libraries(ceph_test_cls_rgw_meta
     librados
-    rgw_a
+    ${rgw_libs}
     global
     cls_version_client
     cls_log_client
-    cls_statelog_client
     cls_refcount_client
     cls_rgw_client
     cls_user_client
     cls_lock_client
-    Boost::regex
     ${BLKID_LIBRARIES}
     ${CURL_LIBRARIES}
     ${EXPAT_LIBRARIES}
     ${CMAKE_DL_LIBS} ${UNITTEST_LIBS} ${CRYPTO_LIBS})
-  set_target_properties(ceph_test_cls_rgw_meta PROPERTIES
-    COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
   install(TARGETS
     ceph_test_cls_rgw_meta
@@ -220,16 +216,14 @@ if(${WITH_RADOSGW})
     )
   target_link_libraries(ceph_test_cls_rgw_log
     librados
-    rgw_a
+    ${rgw_libs}
     global
     cls_version_client
     cls_log_client
-    cls_statelog_client
     cls_refcount_client
     cls_rgw_client
     cls_user_client
     cls_lock_client
-    Boost::regex
     ${BLKID_LIBRARIES}
     ${CURL_LIBRARIES}
     ${EXPAT_LIBRARIES}
@@ -238,45 +232,13 @@ if(${WITH_RADOSGW})
     ${EXTRALIBS}
     ${CRYPTO_LIBS}
     )
-  set_target_properties(ceph_test_cls_rgw_log PROPERTIES COMPILE_FLAGS
-    ${UNITTEST_CXX_FLAGS})
-
-  # ceph_test_cls_rgw_opstate
-  set(ceph_test_cls_rgw_opstate_srcs test_rgw_admin_opstate.cc)
-  add_executable(ceph_test_cls_rgw_opstate
-    ${ceph_test_cls_rgw_opstate_srcs}
-    )
-  target_link_libraries(ceph_test_cls_rgw_opstate
-    rgw_a
-    librados
-    cls_version_client
-    cls_log_client
-    cls_statelog_client
-    cls_timeindex_client
-    cls_refcount_client
-    cls_rgw_client
-    cls_user_client
-    cls_lock_client
-    global
-    ${BLKID_LIBRARIES}
-    ${CURL_LIBRARIES}
-    ${EXPAT_LIBRARIES}
-    ${CMAKE_DL_LIBS}
-    ${UNITTEST_LIBS}
-    ${CRYPTO_LIBS}
-    ${EXTRALIBS}
-    )
-  set_target_properties(ceph_test_cls_rgw_opstate PROPERTIES
-    COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
 # ceph_test_librgw_file (nfs-like RGW interface)
 add_executable(ceph_test_librgw_file
   librgw_file.cc
   )
-set_target_properties(ceph_test_librgw_file PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
 if(WITH_RADOSGW_FCGI_FRONTEND)
-target_include_directories(ceph_test_librgw_file PRIVATE ${FCGI_INCLUDE_DIR})
+target_include_directories(ceph_test_librgw_file SYSTEM PRIVATE ${FCGI_INCLUDE_DIR})
 endif(WITH_RADOSGW_FCGI_FRONTEND)
 target_link_libraries(ceph_test_librgw_file
   rgw
@@ -290,8 +252,6 @@ target_link_libraries(ceph_test_librgw_file
 add_executable(ceph_test_librgw_file_cd
   librgw_file_cd.cc
   )
-set_target_properties(ceph_test_librgw_file_cd PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_librgw_file_cd
   rgw
   librados
@@ -304,8 +264,6 @@ target_link_libraries(ceph_test_librgw_file_cd
 add_executable(ceph_test_librgw_file_gp
   librgw_file_gp.cc
   )
-set_target_properties(ceph_test_librgw_file_gp PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_librgw_file_gp
   rgw
   librados
@@ -318,10 +276,9 @@ target_link_libraries(ceph_test_librgw_file_gp
 add_executable(ceph_test_librgw_file_nfsns
   librgw_file_nfsns.cc
   )
-set_target_properties(ceph_test_librgw_file_nfsns PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
+target_include_directories(ceph_test_librgw_file_nfsns SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw")
 if(WITH_RADOSGW_FCGI_FRONTEND)
-target_include_directories(ceph_test_librgw_file_nfsns PRIVATE ${FCGI_INCLUDE_DIR})
+target_include_directories(ceph_test_librgw_file_nfsns SYSTEM PRIVATE ${FCGI_INCLUDE_DIR})
 endif(WITH_RADOSGW_FCGI_FRONTEND)
 target_link_libraries(ceph_test_librgw_file_nfsns
   rgw
@@ -330,13 +287,15 @@ target_link_libraries(ceph_test_librgw_file_nfsns
   ${UNITTEST_LIBS}
   ${EXTRALIBS}
   )
+if(WITH_BOOST_CONTEXT)
+  target_link_libraries(ceph_test_librgw_file_nfsns spawn)
+endif()
+
 
 # ceph_test_librgw_file_aw (nfs write transaction [atomic write] tests)
 add_executable(ceph_test_librgw_file_aw
   librgw_file_aw.cc
   )
-set_target_properties(ceph_test_librgw_file_aw PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_librgw_file_aw
   rgw
   librados
@@ -349,8 +308,7 @@ target_link_libraries(ceph_test_librgw_file_aw
 add_executable(ceph_test_librgw_file_marker
   librgw_file_marker.cc
   )
-set_target_properties(ceph_test_librgw_file_marker PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
+target_include_directories(ceph_test_librgw_file_marker SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw")
 target_link_libraries(ceph_test_librgw_file_marker
   rgw
   librados
@@ -358,17 +316,17 @@ target_link_libraries(ceph_test_librgw_file_marker
   ${UNITTEST_LIBS}
   ${EXTRALIBS}
   )
+if(WITH_BOOST_CONTEXT)
+  target_link_libraries(ceph_test_librgw_file_marker spawn)
+endif()
 
 # ceph_test_rgw_token
 add_executable(ceph_test_rgw_token
   test_rgw_token.cc
   )
-set_target_properties(ceph_test_rgw_token PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_rgw_token
   rgw
-  os
-  global
+  ceph-common
   ${UNITTEST_LIBS}
   ${EXTRALIBS}
   )
@@ -378,26 +336,22 @@ add_executable(test_rgw_ldap
   ${CMAKE_SOURCE_DIR}/src/rgw/rgw_ldap.cc
   test_rgw_ldap.cc
   )
-set_target_properties(test_rgw_ldap PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
 target_link_libraries(test_rgw_ldap
   librados
   ceph-common
   ${OPENLDAP_LIBRARIES}
   ${UNITTEST_LIBS}
   )
-
 endif(${WITH_RADOSGW})
 
 # ceph_multi_stress_watch
 add_executable(ceph_multi_stress_watch
   multi_stress_watch.cc
   )
-target_link_libraries(ceph_multi_stress_watch librados global radostest
-  ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
+target_link_libraries(ceph_multi_stress_watch librados global radostest-cxx)
 
 #ceph_perf_local
-add_executable(ceph_perf_local 
+add_executable(ceph_perf_local
   perf_local.cc
   perf_helper.cc)
 if(HAVE_SSE)
@@ -410,23 +364,7 @@ if(PERF_LOCAL_FLAGS)
   set_target_properties(ceph_perf_local PROPERTIES COMPILE_FLAGS
     ${PERF_LOCAL_FLAGS})
 endif()
-target_link_libraries(ceph_perf_local os global ${UNITTEST_LIBS})
-
-# ceph_xattr_bench
-add_executable(ceph_xattr_bench
-  xattr_bench.cc
-  )
-set_target_properties(ceph_xattr_bench PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
-target_link_libraries(ceph_xattr_bench
-  os
-  ceph-common
-  ${UNITTEST_LIBS}
-  global
-  ${EXTRALIBS}
-  ${BLKID_LIBRARIES}
-  ${CMAKE_DL_LIBS}
-  )
+target_link_libraries(ceph_perf_local global ${UNITTEST_LIBS})
 
 install(TARGETS
   ceph_bench_log
@@ -434,15 +372,12 @@ install(TARGETS
   ceph_objectstore_bench
   ceph_omapbench
   ceph_perf_local
-  ceph_xattr_bench
   DESTINATION bin)
 
 # ceph_test_filejournal
 add_executable(ceph_test_filejournal
   test_filejournal.cc
   )
-set_target_properties(ceph_test_filejournal PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_filejournal
   os
   ceph-common
@@ -469,17 +404,14 @@ add_executable(ceph_test_snap_mapper
   $<TARGET_OBJECTS:unit-main>
   )
 target_link_libraries(ceph_test_snap_mapper osd global ${BLKID_LIBRARIES} ${UNITTEST_LIBS})
-set_target_properties(ceph_test_snap_mapper PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
 add_executable(ceph_test_stress_watch
   test_stress_watch.cc
   )
-set_target_properties(ceph_test_stress_watch PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
 target_link_libraries(ceph_test_stress_watch
   librados
   ${UNITTEST_LIBS}
-  radostest
+  radostest-cxx
   ${EXTRALIBS}
   ${BLKID_LIBRARIES}
   ${CMAKE_DL_LIBS}
@@ -492,6 +424,9 @@ if(WITH_FUSE)
   add_executable(ceph_test_cfuse_cache_invalidate
     test_cfuse_cache_invalidate.cc
     )
+  target_link_libraries(ceph_test_cfuse_cache_invalidate
+    ceph-common
+  )
 endif(WITH_FUSE)
 
 if(${WITH_CEPHFS})
@@ -503,51 +438,48 @@ if(${WITH_CEPHFS})
     cephfs)
 endif(${WITH_CEPHFS})
 
-if(HAVE_BLKID)
-  add_executable(ceph_test_get_blkdev_size
-    test_get_blkdev_size.cc
+if(HAVE_BLKID OR FREEBSD)
+  add_executable(ceph_test_get_blkdev_props
+    test_get_blkdev_props.cc
     )
-  target_link_libraries(ceph_test_get_blkdev_size
+  target_link_libraries(ceph_test_get_blkdev_props
     ceph-common
     pthread
     ${EXTRALIBS}
     ${BLKID_LIBRARIES}
     ${CMAKE_DL_LIBS}
     )
-endif(HAVE_BLKID)
+endif(HAVE_BLKID OR FREEBSD)
 
 # ceph_test_admin_socket_output
 
-add_executable(ceph_test_admin_socket_output
-  test_admin_socket_output.cc
-  admin_socket_output.cc
-  admin_socket_output_tests.cc
-  )
-target_link_libraries(ceph_test_admin_socket_output
-  ceph-common
-  ${Boost_FILESYSTEM_LIBRARY}
-  )
-install(TARGETS
-  ceph_test_admin_socket_output
-  DESTINATION ${CMAKE_INSTALL_BINDIR})
+if(StdFilesystem_FOUND)
+  add_executable(ceph_test_admin_socket_output
+    test_admin_socket_output.cc
+    admin_socket_output.cc
+    admin_socket_output_tests.cc)
+  target_link_libraries(ceph_test_admin_socket_output
+    ceph-common StdFilesystem::filesystem)
+  install(TARGETS
+    ceph_test_admin_socket_output
+    DESTINATION ${CMAKE_INSTALL_BINDIR})
+endif()
 
 #make check starts here
 
 #following dependencies are run inside make check unit tests
 add_dependencies(tests
   ceph-mon
-  ceph-mgr
-  ceph
   ceph-authtool
   get_command_descriptions
   crushtool
   ceph-conf
   rados
-  ceph-mds
   monmaptool
   ceph-osd
   ceph-dencoder
   ceph-objectstore-tool
+  ceph-kvstore-tool
   ceph-monstore-tool
   osdmaptool
   ceph_example
@@ -556,8 +488,13 @@ add_dependencies(tests
   ceph_test_objectstore
   ceph_erasure_code_non_regression
   ceph_erasure_code
-  ceph-disk
   cython_modules)
+if (WITH_CEPHFS)
+  add_dependencies(tests ceph-mds)
+endif()
+if(WITH_MGR)
+  add_dependencies(tests ceph-mgr)
+endif()
 if(WITH_RBD)
   add_dependencies(tests unittest_librbd rbd)
   if(FREEBSD)
@@ -565,128 +502,121 @@ if(WITH_RBD)
   endif(FREEBSD)
 endif(WITH_RBD)
 if(WITH_RADOSGW)
-  add_dependencies(tests radosgw radosgw-admin)
-endif(WITH_RADOSGW)
-if(NOT FREEBSD)
-  add_dependencies(tests ceph-detect-init)
-endif(NOT FREEBSD)
+  add_dependencies(tests radosgwd radosgw-admin)
+endif()
+#add dependency from fio just to ensure the plugin build isn't failing
+if(WITH_FIO OR WITH_SYSTEM_FIO)
+  add_dependencies(tests fio_ceph_objectstore)
+endif()
 
 if(WITH_RBD)
-  add_ceph_test(run-rbd-unit-tests.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh)
+  # Run rbd-unit-tests separate so they an run in parallel
+  # For values see: src/include/rbd/features.h
+  add_ceph_test(run-rbd-unit-tests-N.sh   ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh N)
+  add_ceph_test(run-rbd-unit-tests-0.sh   ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 0)
+  add_ceph_test(run-rbd-unit-tests-1.sh   ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 1)
+  add_ceph_test(run-rbd-unit-tests-61.sh  ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 61)
+  add_ceph_test(run-rbd-unit-tests-109.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 109)
+  add_ceph_test(run-rbd-unit-tests-127.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 127)
   if(FREEBSD)
     add_ceph_test(rbd-ggate.sh ${CMAKE_CURRENT_SOURCE_DIR}/rbd-ggate.sh)
   endif(FREEBSD)
 endif(WITH_RBD)
 add_ceph_test(run-cli-tests ${CMAKE_CURRENT_SOURCE_DIR}/run-cli-tests)
-add_ceph_test(test_objectstore_memstore.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_objectstore_memstore.sh)
 
-# buggy, see http://tracker.ceph.com/issues/20975
+# flaky, see https://tracker.ceph.com/issues/44243
+#add_ceph_test(test_objectstore_memstore.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_objectstore_memstore.sh)
+
+# flaky
 #add_ceph_test(test_pidfile.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_pidfile.sh)
 
-add_ceph_test(test_subman.sh ${CMAKE_CURRENT_SOURCE_DIR}/test_subman.sh)
 add_ceph_test(smoke.sh ${CMAKE_CURRENT_SOURCE_DIR}/smoke.sh)
-add_ceph_test(unittest_bufferlist.sh ${CMAKE_SOURCE_DIR}/src/unittest_bufferlist.sh)
-
-add_test(NAME run-tox-ceph-disk COMMAND bash ${CMAKE_SOURCE_DIR}/src/ceph-disk/run-tox.sh)
-add_test(NAME run-tox-ceph-detect-init COMMAND bash ${CMAKE_SOURCE_DIR}/src/ceph-detect-init/run-tox.sh)
-
-set(CEPH_DISK_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-disk-virtualenv)
-set(CEPH_DETECT_INIT_VIRTUALENV ${CEPH_BUILD_VIRTUALENV}/ceph-detect-init-virtualenv)
-
-set_property(TEST 
-  run-tox-ceph-disk
-  run-tox-ceph-detect-init
-  PROPERTY ENVIRONMENT
-  CEPH_BUILD_DIR=${CMAKE_BINARY_DIR}
-  CEPH_ROOT=${CMAKE_SOURCE_DIR}
-  CEPH_BIN=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-  CEPH_LIB=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-  CEPH_BUILD_VIRTUALENV=${CEPH_BUILD_VIRTUALENV}
-  CEPH_DISK_VIRTUALENV=${CEPH_DISK_VIRTUALENV}
-  CEPH_DETECT_INIT_VIRTUALENV=${CEPH_DETECT_INIT_VIRTUALENV}
-  LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib
-  PATH=$ENV{PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}:${CMAKE_SOURCE_DIR}/src
-  PYTHONPATH=${CMAKE_SOURCE_DIR}/src/pybind
-  )
+
+set_property(
+  TEST ${tox_tests}
+  PROPERTY ENVIRONMENT ${env_vars_for_tox_tests})
 
 # unittest_admin_socket
 add_executable(unittest_admin_socket
   admin_socket.cc
   $<TARGET_OBJECTS:unit-main>
   )
-add_ceph_unittest(unittest_admin_socket ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_admin_socket)
-target_link_libraries(unittest_admin_socket global) 
+add_ceph_unittest(unittest_admin_socket)
+target_link_libraries(unittest_admin_socket global)
 
 # unittest_encoding
 add_executable(unittest_encoding
   encoding.cc
   )
-add_ceph_unittest(unittest_encoding ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_encoding)
-target_link_libraries(unittest_encoding ceph-common librados ${XIO_LIBRARY} pthread rt m ${BLKID_LIBRARIES})
+add_ceph_unittest(unittest_encoding)
+target_link_libraries(unittest_encoding ceph-common)
 
 # unittest_addrs
 add_executable(unittest_addrs
   test_addrs.cc
   )
-add_ceph_unittest(unittest_addrs ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_addrs)
-target_link_libraries(unittest_addrs ceph-common librados ${XIO_LIBRARY} pthread rt m ${BLKID_LIBRARIES})
+add_ceph_unittest(unittest_addrs)
+target_link_libraries(unittest_addrs ceph-common)
+
+# unittest_auth
+add_executable(unittest_auth
+  test_auth.cc
+  $<TARGET_OBJECTS:unit-main>
+  )
+add_ceph_unittest(unittest_auth)
+target_link_libraries(unittest_auth global)
 
 # unittest_workqueue
 add_executable(unittest_workqueue
   test_workqueue.cc
   $<TARGET_OBJECTS:unit-main>
   )
-add_ceph_unittest(unittest_workqueue ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_workqueue)
-target_link_libraries(unittest_workqueue global ${BLKID_LIBRARIES})
+add_ceph_unittest(unittest_workqueue)
+target_link_libraries(unittest_workqueue global)
 
 # unittest_striper
-add_executable(unittest_striper
-  test_striper.cc
-  $<TARGET_OBJECTS:unit-main>
-  )
-add_ceph_unittest(unittest_striper ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_striper)
-target_link_libraries(unittest_striper global ${BLKID_LIBRARIES})
-
-# unittest_prebufferedstreambuf
-add_executable(unittest_prebufferedstreambuf
-  test_prebufferedstreambuf.cc
-  )
-add_ceph_unittest(unittest_prebufferedstreambuf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_prebufferedstreambuf)
-target_link_libraries(unittest_prebufferedstreambuf global ${BLKID_LIBRARIES})
+if(WITH_LIBRADOSSTRIPER)
+  add_executable(unittest_striper
+    test_striper.cc
+    $<TARGET_OBJECTS:unit-main>
+    )
+  add_ceph_unittest(unittest_striper)
+  target_link_libraries(unittest_striper global ${BLKID_LIBRARIES})
+endif()
 
 # unittest_str_list
 add_executable(unittest_str_list
   test_str_list.cc
   )
-add_ceph_unittest(unittest_str_list ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_str_list)
-target_link_libraries(unittest_str_list global ${BLKID_LIBRARIES})
+add_ceph_unittest(unittest_str_list)
+target_link_libraries(unittest_str_list global)
 
 # unittest_log
 add_executable(unittest_log
   ${CMAKE_SOURCE_DIR}/src/log/test.cc
   )
-add_ceph_unittest(unittest_log ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_log)
+add_ceph_unittest(unittest_log)
 target_link_libraries(unittest_log global)
 
 # unittest_base64
 add_executable(unittest_base64
   base64.cc
   )
-add_ceph_unittest(unittest_base64 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_base64)
-target_link_libraries(unittest_base64 global) 
+add_ceph_unittest(unittest_base64)
+target_link_libraries(unittest_base64 global)
 
 # unittest_ceph_argparse
 add_executable(unittest_ceph_argparse
   ceph_argparse.cc
   )
-add_ceph_unittest(unittest_ceph_argparse ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_argparse)
+add_ceph_unittest(unittest_ceph_argparse)
 target_link_libraries(unittest_ceph_argparse global)
 
 # unittest_ceph_compatset
 add_executable(unittest_ceph_compatset
   ceph_compatset.cc
   )
-add_ceph_unittest(unittest_ceph_compatset ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_compatset)
+add_ceph_unittest(unittest_ceph_compatset)
 target_link_libraries(unittest_ceph_compatset global)
 
 # unittest_gather
@@ -694,14 +624,14 @@ add_executable(unittest_gather
   gather.cc
   $<TARGET_OBJECTS:unit-main>
   )
-add_ceph_unittest(unittest_gather ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_gather)
+add_ceph_unittest(unittest_gather)
 target_link_libraries(unittest_gather global)
 
 # unittest_run_cmd
 add_executable(unittest_run_cmd
   run_cmd.cc
   )
-add_ceph_unittest(unittest_run_cmd ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_run_cmd)
+add_ceph_unittest(unittest_run_cmd)
 target_link_libraries(unittest_run_cmd global)
 
 # signals
@@ -709,57 +639,80 @@ add_executable(unittest_signals
   signals.cc
   $<TARGET_OBJECTS:unit-main>
   )
-add_ceph_unittest(unittest_signals ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_signals)
+add_ceph_unittest(unittest_signals)
 target_link_libraries(unittest_signals global)
 
 # unittest_simple_spin
 add_executable(unittest_simple_spin
   simple_spin.cc
   )
-add_ceph_unittest(unittest_simple_spin ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_simple_spin)
+add_ceph_unittest(unittest_simple_spin)
 target_link_libraries(unittest_simple_spin global)
 
 # unittest_bufferlist
 add_executable(unittest_bufferlist
   bufferlist.cc
+  $<TARGET_OBJECTS:unit-main>
   )
-add_ceph_unittest(unittest_bufferlist ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_bufferlist)
+add_ceph_unittest(unittest_bufferlist)
 target_link_libraries(unittest_bufferlist global)
 
+# compiletest_cxx11_client
+add_executable(compiletest_cxx11_client
+  cxx11_client.cc
+  )
+if(CMAKE_VERSION VERSION_LESS "3.8")
+  # this is ugly as we'll end with -std=c++11 overriding the previous -std=c++17
+  # I would love to have a better way for old Cmakes
+  set_target_properties(compiletest_cxx11_client
+    PROPERTIES COMPILE_FLAGS "-std=c++11 -Werror -pedantic"
+    )
+else()
+  set_target_properties(compiletest_cxx11_client
+    PROPERTIES COMPILE_FLAGS "-Werror -pedantic"
+    CMAKE_CXX_STANDARD 11
+    CXX_STANDARD_REQUIRED ON
+    )
+endif()
+add_ceph_test(compiletest_cxx11_client
+  "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/compiletest_cxx11_client"
+  )
+target_link_libraries(compiletest_cxx11_client global)
+
 # unittest_xlist
 add_executable(unittest_xlist
   test_xlist.cc
   )
-add_ceph_unittest(unittest_xlist ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_xlist)
-target_link_libraries(unittest_xlist ceph-common ${XIO_LIBRARY})
+add_ceph_unittest(unittest_xlist)
+target_link_libraries(unittest_xlist ceph-common)
 
 # unittest_arch
 add_executable(unittest_arch
   test_arch.cc
   $<TARGET_OBJECTS:unit-main>
   )
-add_ceph_unittest(unittest_arch ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_arch)
+add_ceph_unittest(unittest_arch)
 target_link_libraries(unittest_arch global)
 
 # unittest_denc
 add_executable(unittest_denc
   test_denc.cc
   )
-add_ceph_unittest(unittest_denc ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_denc)
-target_link_libraries(unittest_denc os global)
+add_ceph_unittest(unittest_denc)
+target_link_libraries(unittest_denc global)
 
 # unittest_mempool
 add_executable(unittest_mempool
   test_mempool.cc
   )
-add_ceph_unittest(unittest_mempool ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_mempool)
+add_ceph_unittest(unittest_mempool)
 target_link_libraries(unittest_mempool global)
 
 # unittest_features
 add_executable(unittest_features
   test_features.cc
   )
-add_ceph_unittest(unittest_features ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_features)
+add_ceph_unittest(unittest_features)
 target_link_libraries(unittest_features global)
 
 # unittest_crypto
@@ -767,71 +720,65 @@ add_executable(unittest_crypto
   crypto.cc
   $<TARGET_OBJECTS:unit-main>
   )
-add_ceph_unittest(unittest_crypto ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_crypto)
+add_ceph_unittest(unittest_crypto)
 target_link_libraries(unittest_crypto global)
 
 # unittest_crypto_init
 add_executable(unittest_crypto_init
   crypto_init.cc
   )
-add_ceph_unittest(unittest_crypto_init ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_crypto_init)
+add_ceph_unittest(unittest_crypto_init)
 target_link_libraries(unittest_crypto_init global)
 
 # unittest_perf_counters
 add_executable(unittest_perf_counters
   perf_counters.cc
   )
-add_ceph_unittest(unittest_perf_counters ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_perf_counters)
+add_ceph_unittest(unittest_perf_counters)
 target_link_libraries(unittest_perf_counters global)
 
 # unittest_ceph_crypto
 add_executable(unittest_ceph_crypto
-  ceph_crypto.cc
-  )
-add_ceph_unittest(unittest_ceph_crypto ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ceph_crypto)
+  ceph_crypto.cc)
+add_ceph_unittest(unittest_ceph_crypto)
 target_link_libraries(unittest_ceph_crypto global)
 
 # unittest_utf8
 add_executable(unittest_utf8
-  utf8.cc
-  )
-add_ceph_unittest(unittest_utf8 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_utf8)
+  utf8.cc)
+add_ceph_unittest(unittest_utf8)
 target_link_libraries(unittest_utf8 global)
 
 # unittest_mime
 add_executable(unittest_mime
-  mime.cc
-  )
-add_ceph_unittest(unittest_mime ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_mime)
-target_link_libraries(unittest_mime global)
+  mime.cc)
+add_ceph_unittest(unittest_mime)
+target_link_libraries(unittest_mime ceph-common)
 
 # unittest_escape
 add_executable(unittest_escape
-  escape.cc
-  )
-add_ceph_unittest(unittest_escape ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_escape)
-target_link_libraries(unittest_escape global)
+  escape.cc)
+add_ceph_unittest(unittest_escape)
+target_link_libraries(unittest_escape ceph-common)
 
 # unittest_strtol
 add_executable(unittest_strtol
-  strtol.cc
-  )
-add_ceph_unittest(unittest_strtol ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_strtol)
-target_link_libraries(unittest_strtol global)
+  strtol.cc)
+add_ceph_unittest(unittest_strtol)
+target_link_libraries(unittest_strtol ceph-common)
 
 # unittest_confutils
 add_executable(unittest_confutils
-  confutils.cc
-  )
-add_ceph_unittest(unittest_confutils ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_confutils)
-target_link_libraries(unittest_confutils global)
+  confutils.cc)
+add_ceph_unittest(unittest_confutils)
+target_link_libraries(unittest_confutils ceph-common)
 
 # unittest_heartbeatmap
 add_executable(unittest_heartbeatmap
   heartbeat_map.cc
   $<TARGET_OBJECTS:unit-main>
   )
-add_ceph_unittest(unittest_heartbeatmap ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_heartbeatmap)
+add_ceph_unittest(unittest_heartbeatmap)
 target_link_libraries(unittest_heartbeatmap global ceph-common)
 
 if(${WITH_RADOSGW})
@@ -840,7 +787,7 @@ if(${WITH_RADOSGW})
     formatter.cc
     $<TARGET_OBJECTS:unit-main>
     )
-  add_ceph_unittest(unittest_formatter ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_formatter)
+  add_ceph_unittest(unittest_formatter)
   target_link_libraries(unittest_formatter global)
 endif(${WITH_RADOSGW})
 
@@ -849,7 +796,7 @@ add_executable(unittest_daemon_config
   daemon_config.cc
   $<TARGET_OBJECTS:unit-main>
   )
-add_ceph_unittest(unittest_daemon_config ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_daemon_config)
+add_ceph_unittest(unittest_daemon_config)
 target_link_libraries(unittest_daemon_config
   ceph-common
   global
@@ -862,7 +809,7 @@ if(WITH_LIBCEPHFS)
 add_executable(unittest_libcephfs_config
   libcephfs_config.cc
   )
-add_ceph_unittest(unittest_libcephfs_config ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_libcephfs_config)
+add_ceph_unittest(unittest_libcephfs_config)
 target_link_libraries(unittest_libcephfs_config cephfs)
 endif(WITH_LIBCEPHFS)
 
@@ -870,7 +817,7 @@ if(WITH_RBD)
 # unittest_rbd_replay
 add_executable(unittest_rbd_replay
   test_rbd_replay.cc)
-add_ceph_unittest(unittest_rbd_replay ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_rbd_replay)
+add_ceph_unittest(unittest_rbd_replay)
 target_link_libraries(unittest_rbd_replay
   librbd
   librados
@@ -883,36 +830,50 @@ endif(WITH_RBD)
 
 # unittest_ipaddr
 add_executable(unittest_ipaddr
-  test_ipaddr.cc)  
-add_ceph_unittest(unittest_ipaddr ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ipaddr)
-target_link_libraries(unittest_ipaddr mon global)
+  test_ipaddr.cc)
+add_ceph_unittest(unittest_ipaddr)
+target_link_libraries(unittest_ipaddr global)
+
+# unittest_utime
+add_executable(unittest_utime
+  test_utime.cc)
+add_ceph_unittest(unittest_utime)
+target_link_libraries(unittest_utime ceph-common)
 
 # unittest_texttable
 add_executable(unittest_texttable
   test_texttable.cc
-  $<TARGET_OBJECTS:common_texttable_obj>
-  )
-add_ceph_unittest(unittest_texttable ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_texttable)
-target_link_libraries(unittest_texttable mon global)
+  $<TARGET_OBJECTS:common_texttable_obj>)
+add_ceph_unittest(unittest_texttable)
+target_link_libraries(unittest_texttable ceph-common)
 
 # unittest_on_exit
 add_executable(unittest_on_exit
-  on_exit.cc
-  )
-add_ceph_unittest(unittest_on_exit ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_on_exit)
-target_link_libraries(unittest_on_exit global)
+  on_exit.cc)
+add_ceph_unittest(unittest_on_exit)
+target_link_libraries(unittest_on_exit ceph-common)
 
 # unittest_subprocess
 add_executable(unittest_subprocess
-  test_subprocess.cc
-  )
-add_ceph_unittest(unittest_subprocess ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_subprocess)
-target_link_libraries(unittest_subprocess global)
+  test_subprocess.cc)
+add_ceph_unittest(unittest_subprocess)
+target_link_libraries(unittest_subprocess ceph-common)
 
 # unittest_pageset
 add_executable(unittest_pageset test_pageset.cc)
-add_ceph_unittest(unittest_pageset ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_pageset)
-target_link_libraries(unittest_pageset global)
+add_ceph_unittest(unittest_pageset)
+target_link_libraries(unittest_pageset ceph-common)
 
-#make check ends here
+add_executable(unittest_random_string test_random_string.cc $<TARGET_OBJECTS:unit-main>)
+add_ceph_unittest(unittest_random_string)
+target_link_libraries(unittest_random_string global)
 
+# unittest_any_
+add_executable(unittest_any test_any.cc)
+add_ceph_unittest(unittest_any)
+
+# unittest_weighted_shuffle
+add_executable(unittest_weighted_shuffle test_weighted_shuffle.cc)
+add_ceph_unittest(unittest_weighted_shuffle)
+
+#make check ends here