]> 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>
Fri, 12 Jul 2024 21:02:53 +0000 (23:02 +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 8917570863308e23b23869f19bcf65dd613105cf..05ee4f8ad35725d859bdf88b611b68bdaadd7d7e 100644 (file)
@@ -6259,8 +6259,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);
 
@@ -6483,14 +6483,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)