]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: make diff-iterate clone tests exercise fast-diff mode 44673/head
authorIlya Dryomov <idryomov@gmail.com>
Fri, 7 Jan 2022 12:31:08 +0000 (13:31 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 19 Jan 2022 21:15:04 +0000 (22:15 +0100)
The fast-diff feature wasn't propagated to the clone so these tests
were exercising the slow list_snaps path no matter what RBD_FEATURES
value was supplied to ceph_test_librbd.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit ceb13d76f2b3aba7209e85f3354970c072997742)

Conflicts:
src/test/librbd/test_librbd.cc [ commit d1c82d55827e ("librbd:
  enable image cache after getting exclusive lock") not in
  octopus ]

src/test/librbd/test_librbd.cc

index 7a000222b4afe760d4ee4e050121e2837f57ff89..b069fca17f2e4e4df69f868239f0c89e92221343 100644 (file)
@@ -4298,6 +4298,8 @@ TYPED_TEST(DiffIterateTest, DiffIterateIgnoreParent)
   ASSERT_EQ(0, create_image_pp(rbd, ioctx, name.c_str(), size, &order));
   ASSERT_EQ(0, rbd.open(ioctx, image, name.c_str(), NULL));
 
+  uint64_t features;
+  ASSERT_EQ(0, image.features(&features));
   uint64_t object_size = 0;
   if (this->whole_object) {
     object_size = 1 << order;
@@ -4314,7 +4316,7 @@ TYPED_TEST(DiffIterateTest, DiffIterateIgnoreParent)
 
   std::string clone_name = this->get_temp_image_name();
   ASSERT_EQ(0, rbd.clone(ioctx, name.c_str(), "one", ioctx, clone_name.c_str(),
-                         RBD_FEATURE_LAYERING, &order));
+                         features, &order));
   ASSERT_EQ(0, rbd.open(ioctx, image, clone_name.c_str(), NULL));
 
   interval_set<uint64_t> exists;
@@ -4381,6 +4383,8 @@ TYPED_TEST(DiffIterateTest, DiffIterateParentDiscard)
   ASSERT_EQ(0, create_image_pp(rbd, ioctx, name.c_str(), size, &order));
   ASSERT_EQ(0, rbd.open(ioctx, image, name.c_str(), NULL));
 
+  uint64_t features;
+  ASSERT_EQ(0, image.features(&features));
   uint64_t object_size = 0;
   if (this->whole_object) {
     object_size = 1 << order;
@@ -4399,7 +4403,7 @@ TYPED_TEST(DiffIterateTest, DiffIterateParentDiscard)
 
   std::string clone_name = this->get_temp_image_name();
   ASSERT_EQ(0, rbd.clone(ioctx, name.c_str(), "two", ioctx,
-                         clone_name.c_str(), RBD_FEATURE_LAYERING, &order));
+                         clone_name.c_str(), features, &order));
   ASSERT_EQ(0, rbd.open(ioctx, image, clone_name.c_str(), NULL));
 
   interval_set<uint64_t> two;