]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_rados_io_pp: verify sparse_read behavior with non-zero truncate_seq 45103/head
authorJeff Layton <jlayton@redhat.com>
Thu, 3 Mar 2022 21:19:07 +0000 (16:19 -0500)
committerJeff Layton <jlayton@redhat.com>
Mon, 7 Mar 2022 12:50:24 +0000 (07:50 -0500)
Fixes: http://tracker.ceph.com/issues/54280
Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/test/librados/io_cxx.cc

index 64d03380b765d29406b6a6d74b892cc80bc5cc68..455654b6e923f2d5eae9cb85c3060e1cd26ce646 100644 (file)
@@ -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<uint64_t, uint64_t> 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) {