From: Ilya Dryomov Date: Tue, 30 Apr 2024 13:26:38 +0000 (+0200) Subject: test/librbd: correct expected_overlap in SnapshotCopyup X-Git-Tag: v20.0.0~2010^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=adee11c7969b23a56cd296d39bcb342cb003023a;p=ceph.git test/librbd: correct expected_overlap in SnapshotCopyup 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 --- diff --git a/src/test/librbd/test_internal.cc b/src/test/librbd/test_internal.cc index 62de70d5556ff..37930cb26bbc7 100644 --- a/src/test/librbd/test_internal.cc +++ b/src/test/librbd/test_internal.cc @@ -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 > 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());