From aaa75aeb2fe4b6df113b3fdb434a3a6c4023df34 Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Tue, 19 Jul 2016 11:51:01 +0200 Subject: [PATCH 1/5] rpm: Moved ceph-client-debug from ceph-base to ceph-test package Signed-off-by: Ricardo Dias --- ceph.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceph.spec.in b/ceph.spec.in index e04c188a42d63..ba04b88094b29 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -788,7 +788,6 @@ rm -rf %{buildroot} %{_bindir}/osdmaptool %{_bindir}/ceph-run %{_bindir}/ceph-detect-init -%{_bindir}/ceph-client-debug %{_unitdir}/ceph-create-keys@.service %{_libexecdir}/systemd/system-preset/50-ceph.preset %{_sbindir}/ceph-create-keys @@ -1396,6 +1395,7 @@ ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1 %files -n ceph-test %defattr(-,root,root,-) +%{_bindir}/ceph-client-debug %{_bindir}/ceph_bench_log %{_bindir}/ceph_kvstorebench %{_bindir}/ceph_multi_stress_watch From 06875b5099f5909176798fca87ff20cb19bf2bc5 Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Tue, 23 Aug 2016 13:31:05 +0200 Subject: [PATCH 2/5] rpm: Renamed bcond tests flag to make_check Signed-off-by: Ricardo Dias --- ceph.spec.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceph.spec.in b/ceph.spec.in index ba04b88094b29..812c68eeb1225 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -16,7 +16,7 @@ # %bcond_with ocf %bcond_without cephfs_java -%bcond_with tests +%bcond_with make_check %bcond_with xio %ifnarch s390 s390x %bcond_without tcmalloc @@ -707,7 +707,7 @@ cmake .. \ make %{?_smp_mflags} -%if 0%{with tests} +%if 0%{with make_check} %check # run in-tree unittests cd build From a8f8598a73ec90fec719cc09e845eac755191939 Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Tue, 23 Aug 2016 13:32:47 +0200 Subject: [PATCH 3/5] cmake: Use WITH_TESTS flag to guard the build of ceph-test scripts/binaries Signed-off-by: Ricardo Dias --- CMakeLists.txt | 2 ++ doc/man/8/CMakeLists.txt | 5 ++++- src/CMakeLists.txt | 12 ++++++++++-- src/rgw/CMakeLists.txt | 2 ++ src/tools/CMakeLists.txt | 8 ++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f861b057a59e..7aeb4ae6acd5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -371,6 +371,8 @@ option(HAVE_LIBZFS "LibZFS is enabled" OFF) option(ENABLE_COVERAGE "Coverage is enabled" OFF) option(PG_DEBUG_REFS "PG Ref debugging is enabled" OFF) +option(WITH_TESTS "enable the build of ceph-test package scripts/binaries" ON) + if(LINUX) add_definitions(-D__linux__) endif(LINUX) diff --git a/doc/man/8/CMakeLists.txt b/doc/man/8/CMakeLists.txt index 4427fbb0f7036..76bab3a9b3560 100644 --- a/doc/man/8/CMakeLists.txt +++ b/doc/man/8/CMakeLists.txt @@ -13,8 +13,11 @@ set(server_srcs ceph-run.rst mount.ceph.rst ceph-create-keys.rst - ceph-rest-api.rst + ceph-rest-api.rst) +if(WITH_TESTS) +list(APPEND server_srcs ceph-debugpack.rst) +endif(WITH_TESTS) set(osd_srcs ceph-clsinfo.rst diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ddc6b9470176..d0cd125d41346 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -650,18 +650,21 @@ install(TARGETS ceph-mds DESTINATION bin) add_subdirectory(erasure-code) # Support/Tools +if(WITH_TESTS) add_subdirectory(googletest/googlemock) - add_subdirectory(test) +endif(WITH_TESTS) add_subdirectory(compressor) add_subdirectory(tools) +if(WITH_TESTS) configure_file(${CMAKE_SOURCE_DIR}/src/ceph-coverage.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage @ONLY) configure_file(${CMAKE_SOURCE_DIR}/src/ceph-debugpack.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack @ONLY) +endif(WITH_TESTS) configure_file(${CMAKE_SOURCE_DIR}/src/ceph.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph @ONLY) @@ -675,10 +678,15 @@ configure_file(${CMAKE_SOURCE_DIR}/src/init-ceph.in configure_file(ceph-post-file.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file @ONLY) +if(WITH_TESTS) install(PROGRAMS - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage + DESTINATION bin) +endif(WITH_TESTS) + +install(PROGRAMS + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-crush-location ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file ${CMAKE_SOURCE_DIR}/src/ceph-run diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 9014eba81a1a6..2ed17b75476f9 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -1,3 +1,4 @@ +if(WITH_TESTS) add_executable(ceph_rgw_jsonparser rgw_jsonparser.cc) target_link_libraries(ceph_rgw_jsonparser @@ -14,6 +15,7 @@ install(TARGETS ceph_rgw_jsonparser ceph_rgw_multiparser DESTINATION bin) +endif(WITH_TESTS) set(rgw_a_srcs diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index d5a65ca6822e2..ac6ecadedf5be 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -8,6 +8,7 @@ add_executable(rados ${rados_srcs}) target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} radosstriper) install(TARGETS rados DESTINATION bin) +if(WITH_TESTS) add_executable(ceph_scratchtool scratchtool.c) target_link_libraries(ceph_scratchtool librados global) install(TARGETS ceph_scratchtool DESTINATION bin) @@ -30,6 +31,7 @@ install(TARGETS ceph-monstore-tool DESTINATION bin) install(PROGRAMS ceph-monstore-update-crush.sh DESTINATION ${CMAKE_INSTALL_LIBDIR}/ceph) +endif(WITH_TESTS) add_executable(ceph-objectstore-tool ceph_objectstore_tool.cc @@ -41,14 +43,18 @@ endif(WITH_FUSE) install(TARGETS ceph-objectstore-tool DESTINATION bin) if(WITH_LIBCEPHFS) +if(WITH_TESTS) add_executable(ceph-client-debug ceph-client-debug.cc) target_link_libraries(ceph-client-debug cephfs global client) install(TARGETS ceph-client-debug DESTINATION bin) +endif(WITH_TESTS) endif(WITH_LIBCEPHFS) +if(WITH_TESTS) add_executable(ceph-kvstore-tool ceph_kvstore_tool.cc) target_link_libraries(ceph-kvstore-tool os global) install(TARGETS ceph-kvstore-tool DESTINATION bin) +endif(WITH_TESTS) set(ceph_conf_srcs ceph_conf.cc) add_executable(ceph-conf ${ceph_conf_srcs}) @@ -70,10 +76,12 @@ add_executable(osdmaptool ${osdomaptool_srcs}) target_link_libraries(osdmaptool global) install(TARGETS osdmaptool DESTINATION bin) +if(WITH_TESTS) set(ceph_psim_srcs psim.cc) add_executable(ceph_psim ${ceph_psim_srcs}) target_link_libraries(ceph_psim global) install(TARGETS ceph_psim DESTINATION bin) +endif(WITH_TESTS) set(ceph_authtool_srcs ceph_authtool.cc) add_executable(ceph-authtool ${ceph_authtool_srcs}) From 0f347b82ef26e1fd776b44c4a4d05800aa06c3c6 Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Tue, 23 Aug 2016 13:36:55 +0200 Subject: [PATCH 4/5] rpm: Added ceph_test_package bcond flag to control the build of ceph-test package Fixes: http://tracker.ceph.com/issues/16776 Signed-off-by: Ricardo Dias --- ceph.spec.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ceph.spec.in b/ceph.spec.in index 812c68eeb1225..9ba1fd8293730 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -16,6 +16,11 @@ # %bcond_with ocf %bcond_without cephfs_java +%if 0%{?suse_version} +%bcond_with ceph_test_package +%else +%bcond_without ceph_test_package +%endif %bcond_with make_check %bcond_with xio %ifnarch s390 s390x @@ -560,6 +565,7 @@ well as the RESTful interface. These have to do with querying the daemons for command-description information, validating user command input against those descriptions, and submitting the command to the appropriate daemon. +%if 0%{with ceph_test_package} %package -n ceph-test Summary: Ceph benchmarks and test tools Group: System Environment/Libraries @@ -568,6 +574,7 @@ Requires: ceph-common Requires: xmlstarlet %description -n ceph-test This package contains Ceph benchmarks and test tools. +%endif %if 0%{with cephfs_java} @@ -680,6 +687,9 @@ cmake .. \ %if 0%{with xio} -DWITH_XIO=ON \ %endif +%if 0%{without ceph_test_package} + -DWITH_TESTS=OFF \ +%endif %if 0%{with cephfs_java} -DWITH_CEPHFS_JAVA=ON \ %endif @@ -1393,6 +1403,7 @@ ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1 %{python3_sitelib}/ceph_daemon.py %{python3_sitelib}/__pycache__/ceph_daemon.cpython*.py* +%if 0%{with ceph_test_package} %files -n ceph-test %defattr(-,root,root,-) %{_bindir}/ceph-client-debug @@ -1428,6 +1439,7 @@ ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1 %{_mandir}/man8/ceph-debugpack.8* %dir %{_libdir}/ceph %{_libdir}/ceph/ceph-monstore-update-crush.sh +%endif %if 0%{with cephfs_java} %files -n libcephfs_jni1 From d3ac8d186856f615c62ceb8a74a86a74456c4efe Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Tue, 30 Aug 2016 08:29:00 +0100 Subject: [PATCH 5/5] deb: Moved ceph-client-debug from ceph-base to ceph-test package Signed-off-by: Ricardo Dias --- debian/ceph-base.install | 1 - debian/ceph-test.install | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/ceph-base.install b/debian/ceph-base.install index 392c58a08beec..55ba5e20469ba 100644 --- a/debian/ceph-base.install +++ b/debian/ceph-base.install @@ -21,4 +21,3 @@ usr/share/man/man8/osdmaptool.8 usr/lib/python*/dist-packages/ceph_detect_init* usr/share/man/man8/ceph-detect-init.8 usr/share/man/man8/ceph-create-keys.8 -usr/bin/ceph-client-debug diff --git a/debian/ceph-test.install b/debian/ceph-test.install index a8a2a31ebf7f0..15b04664eaab0 100644 --- a/debian/ceph-test.install +++ b/debian/ceph-test.install @@ -1,3 +1,4 @@ +usr/bin/ceph-client-debug usr/bin/ceph-coverage usr/bin/ceph_bench_log usr/bin/ceph_kvstorebench