]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: extend DiffIterateTest.DiffIterateDeterministic{,PP}
authorIlya Dryomov <idryomov@gmail.com>
Fri, 21 Jun 2024 13:56:27 +0000 (15:56 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 8 Jul 2024 14:59:03 +0000 (16:59 +0200)
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 <idryomov@gmail.com>
(cherry picked from commit da69d1fdbf69cf37ba8b75ea9a230634bb25ae76)

src/test/librbd/test_librbd.cc

index 982eb57e9c6a0d6222df46f27c90302910136b8f..a13f6d3ac84e9517ed2377cb85e137fd2ced108c 100644 (file)
@@ -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)