)
target_link_libraries(ceph_bench_log global pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
-# ceph_test_rados
-add_executable(ceph_test_rados
- osd/TestRados.cc
- osd/TestOpStat.cc
- osd/Object.cc osd/RadosModel.cc
- )
-target_link_libraries(ceph_test_rados
- librados
- global
- ${BLKID_LIBRARIES}
- ${CMAKE_DL_LIBS}
- ${EXTRALIBS}
- ${CMAKE_DL_LIBS}
- )
-
# ceph_test_mutate
add_executable(ceph_test_mutate
test_mutate.cc
add_ceph_unittest(unittest_lfnindex ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_lfnindex)
target_link_libraries(unittest_lfnindex os global)
-#osd directory
-add_ceph_test(osd-bench.sh ${CMAKE_SOURCE_DIR}/src/test/osd/osd-bench.sh)
-add_ceph_test(osd-config.sh ${CMAKE_SOURCE_DIR}/src/test/osd/osd-config.sh)
-add_ceph_test(osd-copy-from.sh ${CMAKE_SOURCE_DIR}/src/test/osd/osd-copy-from.sh)
-add_ceph_test(osd-mark-down.sh ${CMAKE_SOURCE_DIR}/src/test/osd/osd-mark-down.sh)
-add_ceph_test(osd-reactivate.sh ${CMAKE_SOURCE_DIR}/src/test/osd/osd-reactivate.sh)
-add_ceph_test(osd-reuse-id.sh ${CMAKE_SOURCE_DIR}/src/test/osd/osd-reuse-id.sh)
-add_ceph_test(osd-scrub-repair.sh ${CMAKE_SOURCE_DIR}/src/test/osd/osd-scrub-repair.sh)
-add_ceph_test(osd-scrub-snaps.sh ${CMAKE_SOURCE_DIR}/src/test/osd/osd-scrub-snaps.sh)
-
-# unittest_osdmap
-add_executable(unittest_osdmap EXCLUDE_FROM_ALL
- osd/TestOSDMap.cc
- )
-add_ceph_unittest(unittest_osdmap ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_osdmap)
-target_link_libraries(unittest_osdmap global ${BLKID_LIBRARIES})
-
-# unittest_osd_types
-add_executable(unittest_osd_types EXCLUDE_FROM_ALL
- osd/types.cc
- )
-add_ceph_unittest(unittest_osd_types ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_osd_types)
-target_link_libraries(unittest_osd_types global)
-
-# unittest_ecbackend
-add_executable(unittest_ecbackend EXCLUDE_FROM_ALL
- osd/TestECBackend.cc
- )
-add_ceph_unittest(unittest_ecbackend ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ecbackend)
-target_link_libraries(unittest_ecbackend osd global)
-
-# unittest_osdscrub
-add_executable(unittest_osdscrub EXCLUDE_FROM_ALL
- osd/TestOSDScrub.cc
- )
-add_ceph_unittest(unittest_osdscrub ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_osdscrub)
-target_link_libraries(unittest_osdscrub osd global dl os mon ${BLKID_LIBRARIES})
-
-# unittest_pglog
-add_executable(unittest_pglog EXCLUDE_FROM_ALL
- osd/TestPGLog.cc
- )
-add_ceph_unittest(unittest_pglog ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_pglog)
-target_link_libraries(unittest_pglog osd global dl ${BLKID_LIBRARIES})
-
-# unittest_hitset
-add_executable(unittest_hitset EXCLUDE_FROM_ALL
- osd/hitset.cc
- )
-add_ceph_unittest(unittest_hitset ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_hitset)
-target_link_libraries(unittest_hitset osd global ${BLKID_LIBRARIES})
-
-# unittest_osd_osdcap
-add_executable(unittest_osd_osdcap EXCLUDE_FROM_ALL
- osd/osdcap.cc
-)
-add_ceph_unittest(unittest_osd_osdcap ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_osd_osdcap)
-target_link_libraries(unittest_osd_osdcap osd global ${BLKID_LIBRARIES})
+add_subdirectory(osd)
#pybind
add_ceph_test(test_ceph_daemon.py ${CMAKE_SOURCE_DIR}/src/test/pybind/test_ceph_daemon.py)
--- /dev/null
+# test_rados
+add_executable(ceph_test_rados
+ TestRados.cc
+ TestOpStat.cc
+ Object.cc
+ RadosModel.cc
+ )
+target_link_libraries(ceph_test_rados
+ librados
+ global
+ ${BLKID_LIBRARIES}
+ ${CMAKE_DL_LIBS}
+ ${EXTRALIBS}
+ ${CMAKE_DL_LIBS}
+ )
+
+# scripts
+add_ceph_test(osd-bench.sh ${CMAKE_CURRENT_SOURCE_DIR}/osd-bench.sh)
+add_ceph_test(osd-config.sh ${CMAKE_CURRENT_SOURCE_DIR}/osd-config.sh)
+add_ceph_test(osd-markdown.sh ${CMAKE_CURRENT_SOURCE_DIR}/osd-markdown.sh)
+add_ceph_test(osd-reactivate.sh ${CMAKE_CURRENT_SOURCE_DIR}/osd-reactivate.sh)
+add_ceph_test(osd-reuse-id.sh ${CMAKE_CURRENT_SOURCE_DIR}/osd-reuse-id.sh)
+add_ceph_test(osd-scrub-repair.sh ${CMAKE_CURRENT_SOURCE_DIR}/osd-scrub-repair.sh)
+add_ceph_test(osd-scrub-snaps.sh ${CMAKE_CURRENT_SOURCE_DIR}/osd-scrub-snaps.sh)
+
+#osd-copy-from.sh needs to be run out of ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+add_test(NAME osd-copy-from.sh COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/osd-copy-from.sh WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+add_dependencies(check osd-copy-from.sh)
+
+set_property(TEST
+ osd-copy-from.sh
+ PROPERTY ENVIRONMENT
+ CEPH_ROOT=${CMAKE_SOURCE_DIR}
+ CEPH_BIN=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ CEPH_LIB=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib
+ PATH=$ENV{PATH}:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}:${CMAKE_SOURCE_DIR}/src
+ PYTHONPATH=${CMAKE_SOURCE_DIR}/src/pybind
+ )
+
+
+# unittest_osdmap
+add_executable(unittest_osdmap EXCLUDE_FROM_ALL
+ TestOSDMap.cc
+ )
+add_ceph_unittest(unittest_osdmap ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_osdmap)
+target_link_libraries(unittest_osdmap global ${BLKID_LIBRARIES})
+
+# unittest_osd_types
+add_executable(unittest_osd_types EXCLUDE_FROM_ALL
+ types.cc
+ )
+add_ceph_unittest(unittest_osd_types ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_osd_types)
+target_link_libraries(unittest_osd_types global)
+
+# unittest_ecbackend
+add_executable(unittest_ecbackend EXCLUDE_FROM_ALL
+ TestECBackend.cc
+ )
+add_ceph_unittest(unittest_ecbackend ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_ecbackend)
+target_link_libraries(unittest_ecbackend osd global)
+
+# unittest_osdscrub
+add_executable(unittest_osdscrub EXCLUDE_FROM_ALL
+ TestOSDScrub.cc
+ )
+add_ceph_unittest(unittest_osdscrub ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_osdscrub)
+target_link_libraries(unittest_osdscrub osd global dl os mon ${BLKID_LIBRARIES})
+
+# unittest_pglog
+add_executable(unittest_pglog EXCLUDE_FROM_ALL
+ TestPGLog.cc
+ )
+add_ceph_unittest(unittest_pglog ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_pglog)
+target_link_libraries(unittest_pglog osd global dl ${BLKID_LIBRARIES})
+
+# unittest_hitset
+add_executable(unittest_hitset EXCLUDE_FROM_ALL
+ hitset.cc
+ )
+add_ceph_unittest(unittest_hitset ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_hitset)
+target_link_libraries(unittest_hitset osd global ${BLKID_LIBRARIES})
+
+# unittest_osd_osdcap
+add_executable(unittest_osd_osdcap EXCLUDE_FROM_ALL
+ osdcap.cc
+)
+add_ceph_unittest(unittest_osd_osdcap ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_osd_osdcap)
+target_link_libraries(unittest_osd_osdcap osd global ${BLKID_LIBRARIES})
+
# GNU Library Public License for more details.
#
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
function run() {
local dir=$1
run_mon $dir a || return 1
run_osd $dir 0 || return 1
- local osd_bench_small_size_max_iops=$(CEPH_ARGS='' ./ceph-conf \
+ local osd_bench_small_size_max_iops=$(CEPH_ARGS='' ceph-conf \
--show-config-value osd_bench_small_size_max_iops)
- local osd_bench_large_size_max_throughput=$(CEPH_ARGS='' ./ceph-conf \
+ local osd_bench_large_size_max_throughput=$(CEPH_ARGS='' ceph-conf \
--show-config-value osd_bench_large_size_max_throughput)
- local osd_bench_max_block_size=$(CEPH_ARGS='' ./ceph-conf \
+ local osd_bench_max_block_size=$(CEPH_ARGS='' ceph-conf \
--show-config-value osd_bench_max_block_size)
- local osd_bench_duration=$(CEPH_ARGS='' ./ceph-conf \
+ local osd_bench_duration=$(CEPH_ARGS='' ceph-conf \
--show-config-value osd_bench_duration)
#
# block size too high
#
expect_failure $dir osd_bench_max_block_size \
- ./ceph tell osd.0 bench 1024 $((osd_bench_max_block_size + 1)) || return 1
+ ceph tell osd.0 bench 1024 $((osd_bench_max_block_size + 1)) || return 1
#
# count too high for small (< 1MB) block sizes
local bsize=1024
local max_count=$(($bsize * $osd_bench_duration * $osd_bench_small_size_max_iops))
expect_failure $dir bench_small_size_max_iops \
- ./ceph tell osd.0 bench $(($max_count + 1)) $bsize || return 1
+ ceph tell osd.0 bench $(($max_count + 1)) $bsize || return 1
#
# count too high for large (>= 1MB) block sizes
local bsize=$((1024 * 1024 + 1))
local max_count=$(($osd_bench_large_size_max_throughput * $osd_bench_duration))
expect_failure $dir osd_bench_large_size_max_throughput \
- ./ceph tell osd.0 bench $(($max_count + 1)) $bsize || return 1
+ ceph tell osd.0 bench $(($max_count + 1)) $bsize || return 1
#
# default values should work
#
- ./ceph tell osd.0 bench || return 1
+ ceph tell osd.0 bench || return 1
}
main osd-bench "$@"
# GNU Library Public License for more details.
#
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
function run() {
local dir=$1
--osd-map-cache-size $cache \
--osd-pg-epoch-persisted-max-stale $stale \
|| return 1
- CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
+ CEPH_ARGS='' ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
grep 'is not > osd_pg_epoch_persisted_max_stale' $dir/osd.0.log || return 1
}
run_mon $dir a || return 1
run_osd $dir 0 || return 1
- local osd_map_cache_size=$(CEPH_ARGS='' ./ceph-conf \
+ local osd_map_cache_size=$(CEPH_ARGS='' ceph-conf \
--show-config-value osd_map_cache_size)
- local osd_map_max_advance=$(CEPH_ARGS='' ./ceph-conf \
+ local osd_map_max_advance=$(CEPH_ARGS='' ceph-conf \
--show-config-value osd_map_max_advance)
- local osd_pg_epoch_persisted_max_stale=$(CEPH_ARGS='' ./ceph-conf \
+ local osd_pg_epoch_persisted_max_stale=$(CEPH_ARGS='' ceph-conf \
--show-config-value osd_pg_epoch_persisted_max_stale)
#
# lower cache_size under max_advance to trigger the warning
#
! grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
local cache=$(($osd_map_max_advance / 2))
- ./ceph tell osd.0 injectargs "--osd-map-cache-size $cache" || return 1
- CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
+ ceph tell osd.0 injectargs "--osd-map-cache-size $cache" || return 1
+ CEPH_ARGS='' ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
rm $dir/osd.0.log
- CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log reopen || return 1
+ CEPH_ARGS='' ceph --admin-daemon $dir/ceph-osd.0.asok log reopen || return 1
#
# reset cache_size to the default and assert that it does not trigger the warning
#
! grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
local cache=$osd_map_cache_size
- ./ceph tell osd.0 injectargs "--osd-map-cache-size $cache" || return 1
- CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
+ ceph tell osd.0 injectargs "--osd-map-cache-size $cache" || return 1
+ CEPH_ARGS='' ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
! grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
#
#
! grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
local advance=$(($osd_map_cache_size * 2))
- ./ceph tell osd.0 injectargs "--osd-map-max-advance $advance" || return 1
- CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
+ ceph tell osd.0 injectargs "--osd-map-max-advance $advance" || return 1
+ CEPH_ARGS='' ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
grep 'is not > osd_map_max_advance' $dir/osd.0.log || return 1
#
! grep 'is not > osd_pg_epoch_persisted_max_stale' $dir/osd.0.log || return 1
local stale=$(($osd_map_cache_size * 2))
ceph tell osd.0 injectargs "--osd-pg-epoch-persisted-max-stale $stale" || return 1
- CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
+ CEPH_ARGS='' ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
grep 'is not > osd_pg_epoch_persisted_max_stale' $dir/osd.0.log || return 1
}
# GNU Library Public License for more details.
#
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
function run() {
local dir=$1
run_osd $dir 1 || return 1
# success
- ./rados -p rbd put foo rados
- ./rados -p rbd cp foo foo2
- ./rados -p rbd stat foo2
+ rados -p rbd put foo rados
+ rados -p rbd cp foo foo2
+ rados -p rbd stat foo2
# failure
- ./ceph tell osd.\* injectargs -- --osd-debug-inject-copyfrom-error
- ! ./rados -p rbd cp foo foo3
- ! ./rados -p rbd stat foo3
+ ceph tell osd.\* injectargs -- --osd-debug-inject-copyfrom-error
+ ! rados -p rbd cp foo foo3
+ ! rados -p rbd stat foo3
# success again
- ./ceph tell osd.\* injectargs -- --no-osd-debug-inject-copyfrom-error
- ! ./rados -p rbd cp foo foo3
- ./rados -p rbd stat foo3
+ ceph tell osd.\* injectargs -- --no-osd-debug-inject-copyfrom-error
+ ! rados -p rbd cp foo foo3
+ rados -p rbd stat foo3
}
main osd-copy-from "$@"
# GNU Library Public License for more details.
#
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
function run() {
local dir=$1
for i in `seq 1 $markdown_times`
do
# check the OSD is UP
- ./ceph osd tree
- ./ceph osd tree | grep osd.0 |grep up || return 1
+ ceph osd tree
+ ceph osd tree | grep osd.0 |grep up || return 1
# mark the OSD down.
- ./ceph osd down 0
+ ceph osd down 0
sleep $sleeptime
done
}
ceph tell osd.0 injectargs '--osd_max_markdown_period '$period'' || return 1
markdown_N_impl $(($count+1)) $period $sleeptime
- ./ceph osd tree | grep down | grep osd.0 || return 1
+ # down N+1 times ,the osd.0 shoud die
+ ceph osd tree | grep down | grep osd.0 || return 1
}
function TEST_markdown_boot() {
markdown_N_impl $count $period $sleeptime
#down N times, osd.0 should be up
- ./ceph osd tree | grep up | grep osd.0 || return 1
+ ceph osd tree | grep up | grep osd.0 || return 1
}
function TEST_markdown_boot_exceed_time() {
ceph tell osd.0 injectargs '--osd_max_markdown_period '$period'' || return 1
markdown_N_impl $(($count+1)) $period $sleeptime
- ./ceph osd tree | grep up | grep osd.0 || return 1
+ ceph osd tree | grep up | grep osd.0 || return 1
}
main osd-markdown "$@"
# GNU Library Public License for more details.
#
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
function run() {
local dir=$1
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
function run() {
local dir=$1
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
function run() {
local dir=$1
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
function run() {
local dir=$1