]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
unittest_alloc: add test_alloc_big 14844/head
authorSage Weil <sage@redhat.com>
Thu, 4 May 2017 13:11:13 +0000 (08:11 -0500)
committerSage Weil <sage@redhat.com>
Thu, 4 May 2017 13:11:13 +0000 (08:11 -0500)
Ensure that big allocations work.

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

Signed-off-by: Sage Weil <sage@redhat.com>
src/test/objectstore/Allocator_test.cc

index 3a408265962903ffa017bb8e7ebc389cdd82dc97..65f8e47bd0864e4c5d8091ee58e5b908f92ddc74 100644 (file)
@@ -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")) {