Skip to content

Commit 30a2e86

Browse files
committed
test/osd: unit-tests for the scrubber scheduler
Adding unittest_scrub_sched, testing the way scrubs are scheduled. Signed-off-by: Ronen Friedman <[email protected]>
1 parent 603a29a commit 30a2e86

File tree

4 files changed

+410
-3
lines changed

4 files changed

+410
-3
lines changed

src/osd/scrubber/osd_scrub_sched.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,8 @@ ScrubQueue::sched_params_t ScrubQueue::determine_scrub_time(
225225
const pool_opts_t pool_conf) const
226226
{
227227
ScrubQueue::sched_params_t res;
228-
229-
//dout(15) << fmt::format(": requested_scrub_t: {}", request_flags) << dendl; // RRR
230228
dout(15) << ": requested_scrub_t: {}" << request_flags << dendl;
231229

232-
233230
if (request_flags.must_scrub || request_flags.need_auto) {
234231

235232
// Set the smallest time that isn't utime_t()

src/osd/scrubber/osd_scrub_sched.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ class ScrubQueue {
278278
};
279279

280280
friend class TestOSDScrub;
281+
friend class ScrubSchedTestWrapper; ///< unit-tests structure
281282

282283
using ScrubJobRef = ceph::ref_t<ScrubJob>;
283284
using ScrubQContainer = std::vector<ScrubJobRef>;

src/test/osd/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ add_executable(unittest_scrubber_be
7676
add_ceph_unittest(unittest_scrubber_be)
7777
target_link_libraries(unittest_scrubber_be osd os global ${CMAKE_DL_LIBS} mon ${BLKID_LIBRARIES})
7878

79+
# unittest_scrub_sched
80+
add_executable(unittest_scrub_sched
81+
test_scrub_sched.cc
82+
)
83+
add_ceph_unittest(unittest_scrub_sched)
84+
target_link_libraries(unittest_scrub_sched osd os global ${CMAKE_DL_LIBS} mon ${BLKID_LIBRARIES})
85+
7986
# unittest_pglog
8087
add_executable(unittest_pglog
8188
TestPGLog.cc

0 commit comments

Comments
 (0)