From: Sage Weil Date: Fri, 13 May 2016 16:51:28 +0000 (-0400) Subject: ceph_test_objectstore: expand SimpleObjectTest a bit X-Git-Tag: v11.0.0~359^2~90 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=93cea350cb8e1095aad37b85446b9ec513c4606a;p=ceph.git ceph_test_objectstore: expand SimpleObjectTest a bit Signed-off-by: Sage Weil --- diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 687a571e671..e1f1943a196 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -524,6 +524,34 @@ TEST_P(StoreTest, SimpleObjectTest) { in.hexdump(cout); ASSERT_TRUE(in.contents_equal(exp)); } + { + { + ObjectStore::Transaction t; + bufferlist bl; + bl.append("fghij"); + t.truncate(cid, hoid, 0); + t.write(cid, hoid, 5, 5, bl); + cerr << "Truncate + hole" << std::endl; + r = apply_transaction(store, &osr, std::move(t)); + ASSERT_EQ(r, 0); + } + { + ObjectStore::Transaction t; + bufferlist bl; + bl.append("abcde"); + t.write(cid, hoid, 0, 5, bl); + cerr << "Reverse fill-in" << std::endl; + r = apply_transaction(store, &osr, std::move(t)); + ASSERT_EQ(r, 0); + } + + bufferlist in, exp; + exp.append("abcdefghij"); + r = store->read(cid, hoid, 0, 10, in); + ASSERT_EQ(10, r); + in.hexdump(cout); + ASSERT_TRUE(in.contents_equal(exp)); + } { ObjectStore::Transaction t; bufferlist bl;