From da69d1fdbf69cf37ba8b75ea9a230634bb25ae76 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Fri, 21 Jun 2024 15:56:27 +0200 Subject: [PATCH] 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 --- src/test/librbd/test_librbd.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 3c7864676ca..7445c6710fc 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -7652,8 +7652,8 @@ private: void test_deterministic_pp(librbd::Image& image, uint64_t object_off, uint64_t len, uint64_t block_size) { - uint64_t off1 = 0 << 20; - uint64_t off2 = 4 << 20; + uint64_t off1 = 8 << 20; + uint64_t off2 = 16 << 20; uint64_t size = 20 << 20; uint64_t extent_len = round_up_to(object_off + len, block_size); @@ -7876,14 +7876,22 @@ TYPED_TEST(DiffIterateTest, DiffIterateDeterministic) { REQUIRE(!is_feature_enabled(RBD_FEATURE_STRIPINGV2)); - this->test_deterministic(0, 256); + EXPECT_NO_FATAL_FAILURE(this->test_deterministic(0, 256)); + EXPECT_NO_FATAL_FAILURE(this->test_deterministic((1 << 20) - 256, 256)); + EXPECT_NO_FATAL_FAILURE(this->test_deterministic((1 << 20) - 128, 256)); + EXPECT_NO_FATAL_FAILURE(this->test_deterministic(1 << 20, 256)); + EXPECT_NO_FATAL_FAILURE(this->test_deterministic((4 << 20) - 256, 256)); } TYPED_TEST(DiffIterateTest, DiffIterateDeterministicPP) { REQUIRE(!is_feature_enabled(RBD_FEATURE_STRIPINGV2)); - this->test_deterministic_pp(0, 256); + EXPECT_NO_FATAL_FAILURE(this->test_deterministic_pp(0, 2)); + EXPECT_NO_FATAL_FAILURE(this->test_deterministic_pp((3 << 20) - 2, 2)); + EXPECT_NO_FATAL_FAILURE(this->test_deterministic_pp((3 << 20) - 1, 2)); + EXPECT_NO_FATAL_FAILURE(this->test_deterministic_pp(3 << 20, 2)); + EXPECT_NO_FATAL_FAILURE(this->test_deterministic_pp((4 << 20) - 2, 2)); } TYPED_TEST(DiffIterateTest, DiffIterateDiscard) -- 2.39.5