From: Haomai Wang Date: Sat, 7 Jun 2014 10:27:25 +0000 (+0800) Subject: Add set_alloc_hint test to ceph_test_objectstore X-Git-Tag: v0.83~107^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1f40c356a0881fd300cfee3a1e6e4268a7263cb1;p=ceph.git Add set_alloc_hint test to ceph_test_objectstore Signed-off-by: Haomai Wang --- diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 582327303ea0..205dfed67a20 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -1183,6 +1183,43 @@ TEST_P(StoreTest, MoveRename) { } } +TEST_P(StoreTest, SetAllocHint) { + coll_t cid("alloc_hint"); + ghobject_t hoid(hobject_t("test_hint", "", CEPH_NOSNAP, 0, 0, "")); + int r; + { + ObjectStore::Transaction t; + t.create_collection(cid); + t.touch(cid, hoid); + r = store->apply_transaction(t); + ASSERT_EQ(r, 0); + } + { + ObjectStore::Transaction t; + t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*4); + r = store->apply_transaction(t); + ASSERT_EQ(r, 0); + } + { + ObjectStore::Transaction t; + t.remove(cid, hoid); + r = store->apply_transaction(t); + ASSERT_EQ(r, 0); + } + { + ObjectStore::Transaction t; + t.set_alloc_hint(cid, hoid, 4*1024*1024, 1024*4); + r = store->apply_transaction(t); + ASSERT_EQ(r, 0); + } + { + ObjectStore::Transaction t; + t.remove_collection(cid); + r = store->apply_transaction(t); + ASSERT_EQ(r, 0); + } +} + INSTANTIATE_TEST_CASE_P( ObjectStore, StoreTest,