From: Sage Weil Date: Thu, 4 May 2017 13:11:13 +0000 (-0500) Subject: unittest_alloc: add test_alloc_big X-Git-Tag: v12.0.3~96^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e61d9e4ada418404571f216a84fa4ed237104476;p=ceph.git unittest_alloc: add test_alloc_big Ensure that big allocations work. Verifies http://tracker.ceph.com/issues/16662 Signed-off-by: Sage Weil --- diff --git a/src/test/objectstore/Allocator_test.cc b/src/test/objectstore/Allocator_test.cc index 3a4082659629..65f8e47bd086 100644 --- a/src/test/objectstore/Allocator_test.cc +++ b/src/test/objectstore/Allocator_test.cc @@ -200,6 +200,22 @@ TEST_P(AllocTest, test_alloc_failure) } } +TEST_P(AllocTest, test_alloc_big) +{ + int64_t block_size = 4096; + int64_t blocks = 104857600; + int64_t mas = 4096; + init_alloc(blocks*block_size, block_size); + alloc->init_add_free(2*block_size, (blocks-2)*block_size); + for (int64_t big = mas; big < 1048576*128; big*=2) { + cout << big << std::endl; + EXPECT_EQ(alloc->reserve(big), 0); + AllocExtentVector extents; + EXPECT_EQ(big, + alloc->allocate(big, mas, 0, &extents)); + } +} + TEST_P(AllocTest, test_alloc_hint_bmap) { if (GetParam() == std::string("stupid")) {