From: Jeff Layton Date: Thu, 3 Mar 2022 21:19:07 +0000 (-0500) Subject: ceph_test_rados_io_pp: verify sparse_read behavior with non-zero truncate_seq X-Git-Tag: v18.0.0~1239^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45103%2Fhead;p=ceph.git ceph_test_rados_io_pp: verify sparse_read behavior with non-zero truncate_seq Fixes: http://tracker.ceph.com/issues/54280 Signed-off-by: Jeff Layton --- diff --git a/src/test/librados/io_cxx.cc b/src/test/librados/io_cxx.cc index 64d03380b765..455654b6e923 100644 --- a/src/test/librados/io_cxx.cc +++ b/src/test/librados/io_cxx.cc @@ -201,6 +201,19 @@ TEST_F(LibRadosIoPP, SparseReadOpPP) { ASSERT_EQ(0, rval); assert_eq_sparse(bl, extents, read_bl); } + { + bufferlist bl; + bl.append(buf, sizeof(buf) / 2); + + std::map extents; + bufferlist read_bl; + int rval = -1; + ObjectReadOperation op; + op.sparse_read(0, sizeof(buf), &extents, &read_bl, &rval, sizeof(buf) / 2, 1); + ASSERT_EQ(0, ioctx.operate("foo", &op, nullptr)); + ASSERT_EQ(0, rval); + assert_eq_sparse(bl, extents, read_bl); + } } TEST_F(LibRadosIoPP, RoundTripPP) {