From: Haomai Wang Date: Thu, 27 Feb 2014 02:49:10 +0000 (+0800) Subject: Add test for objectstore X-Git-Tag: v0.83~95^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1941%2Fhead;p=ceph.git Add test for objectstore Add remove then write object in a transaction. Signed-off-by: Haomai Wang --- diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 582327303ea..f26229fe082 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -135,6 +135,24 @@ TEST_P(StoreTest, SimpleObjectTest) { r = store->apply_transaction(t); ASSERT_EQ(r, 0); } + { + ObjectStore::Transaction t; + t.remove(cid, hoid); + t.touch(cid, hoid); + cerr << "Remove then create" << std::endl; + r = store->apply_transaction(t); + ASSERT_EQ(r, 0); + } + { + ObjectStore::Transaction t; + bufferlist bl; + bl.append("abcde"); + t.remove(cid, hoid); + t.write(cid, hoid, 10, 5, bl); + cerr << "Remove then create" << std::endl; + r = store->apply_transaction(t); + ASSERT_EQ(r, 0); + } { ObjectStore::Transaction t; t.remove(cid, hoid);