]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: correct expected_overlap in SnapshotCopyup 57163/head
authorIlya Dryomov <idryomov@gmail.com>
Tue, 30 Apr 2024 13:26:38 +0000 (15:26 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 30 Apr 2024 13:26:38 +0000 (15:26 +0200)
Changing the end of second interval from 2096640 to copyup_end - 512
with copyup_end potentially set to 1 << order in commit 750e61ac91d7
("librbd: clone copy-on-write operations should preserve sparseness")
was incorrect because the test image size is just 2M.  There are no
end-to-end tests for enable_sparse_copyup = false case, so this went
unnoticed.

A year later, commit 38622b5ca12d ("librbd: copyup state machine
should always issue a sparse-read") dropped the respective branch in
CopyupRequest, thus eliminating the reason for branching on
enable_sparse_copyup altogether.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/test/librbd/test_internal.cc

index 62de70d5556ff459b5b5fc3a5ac76f5f06c4ef9c..37930cb26bbc78ba212d1b44c740f36e381282a7 100644 (file)
@@ -704,11 +704,10 @@ TEST_F(TestInternal, SnapshotCopyup)
   librados::snap_set_t snap_set;
   ASSERT_EQ(0, snap_ctx.list_snaps(ictx2->get_object_name(0), &snap_set));
 
-  uint64_t copyup_end = ictx2->enable_sparse_copyup ? 4096 * 5 : 1 << order;
   std::vector< std::pair<uint64_t,uint64_t> > expected_overlap =
     boost::assign::list_of(
       std::make_pair(0, 4096))(
-      std::make_pair(4096 * 2, copyup_end - 4096 * 2));
+      std::make_pair(4096 * 2, 4096 * 3));
   ASSERT_EQ(2U, snap_set.clones.size());
   ASSERT_NE(CEPH_NOSNAP, snap_set.clones[0].cloneid);
   ASSERT_EQ(2U, snap_set.clones[0].snaps.size());