Skip to content

Commit

Permalink
unittest_alloc: add test_alloc_big
Browse files Browse the repository at this point in the history
Ensure that big allocations work.

Verifies http://tracker.ceph.com/issues/16662

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed May 4, 2017
1 parent 577cca0 commit e61d9e4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/objectstore/Allocator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit e61d9e4

Please sign in to comment.