Skip to content

Commit da69d1f

Browse files
committed
test/librbd: extend DiffIterateTest.DiffIterateDeterministic{,PP}
Currently we are laying data only at the beginning of an object. Extend the skeletons to write to three different offsets in the middle and also at the end of the object. Separately, make C and C++ API test variants slightly different in terms of offsets being targeted to not go through exactly the same scenario twice. Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 1df8799 commit da69d1f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/test/librbd/test_librbd.cc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7652,8 +7652,8 @@ class DiffIterateTest : public TestLibRBD {
76527652

76537653
void test_deterministic_pp(librbd::Image& image, uint64_t object_off,
76547654
uint64_t len, uint64_t block_size) {
7655-
uint64_t off1 = 0 << 20;
7656-
uint64_t off2 = 4 << 20;
7655+
uint64_t off1 = 8 << 20;
7656+
uint64_t off2 = 16 << 20;
76577657
uint64_t size = 20 << 20;
76587658
uint64_t extent_len = round_up_to(object_off + len, block_size);
76597659

@@ -7876,14 +7876,22 @@ TYPED_TEST(DiffIterateTest, DiffIterateDeterministic)
78767876
{
78777877
REQUIRE(!is_feature_enabled(RBD_FEATURE_STRIPINGV2));
78787878

7879-
this->test_deterministic(0, 256);
7879+
EXPECT_NO_FATAL_FAILURE(this->test_deterministic(0, 256));
7880+
EXPECT_NO_FATAL_FAILURE(this->test_deterministic((1 << 20) - 256, 256));
7881+
EXPECT_NO_FATAL_FAILURE(this->test_deterministic((1 << 20) - 128, 256));
7882+
EXPECT_NO_FATAL_FAILURE(this->test_deterministic(1 << 20, 256));
7883+
EXPECT_NO_FATAL_FAILURE(this->test_deterministic((4 << 20) - 256, 256));
78807884
}
78817885

78827886
TYPED_TEST(DiffIterateTest, DiffIterateDeterministicPP)
78837887
{
78847888
REQUIRE(!is_feature_enabled(RBD_FEATURE_STRIPINGV2));
78857889

7886-
this->test_deterministic_pp(0, 256);
7890+
EXPECT_NO_FATAL_FAILURE(this->test_deterministic_pp(0, 2));
7891+
EXPECT_NO_FATAL_FAILURE(this->test_deterministic_pp((3 << 20) - 2, 2));
7892+
EXPECT_NO_FATAL_FAILURE(this->test_deterministic_pp((3 << 20) - 1, 2));
7893+
EXPECT_NO_FATAL_FAILURE(this->test_deterministic_pp(3 << 20, 2));
7894+
EXPECT_NO_FATAL_FAILURE(this->test_deterministic_pp((4 << 20) - 2, 2));
78877895
}
78887896

78897897
TYPED_TEST(DiffIterateTest, DiffIterateDiscard)

0 commit comments

Comments
 (0)