From ac6d07b245c9398fca620d33c606d91bd8c2e16d Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Fri, 15 Jun 2018 13:48:03 +0300 Subject: [PATCH] test/store_test: add test coverage for tiny device misuse. Signed-off-by: Igor Fedotov --- src/test/objectstore/store_test.cc | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 0ce09665f69..47795b690fb 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -7033,6 +7033,43 @@ TEST_P(StoreTest, BluestoreStatistics) { f->flush(cout); cout << std::endl; } + +TEST_P(StoreTestSpecificAUSize, BluestoreTinyDevFailure) { + if (string(GetParam()) != "bluestore") + return; + // This caused superblock overwrite by bluefs, see + // https://tracker.ceph.com/issues/24480 + SetVal(g_conf(), "bluestore_block_size", + stringify(1024 * 1024 * 1024).c_str()); //1 Gb + SetVal(g_conf(), "bluestore_block_db_size", "0"); + SetVal(g_conf(), "bluestore_block_db_create", "false"); + SetVal(g_conf(), "bluestore_bluefs_min", + stringify(1024 * 1024 * 1024).c_str()); + StartDeferred(0x1000); + store->umount(); + ASSERT_EQ(store->fsck(false), 0); // do fsck explicitly + store->mount(); +} + +TEST_P(StoreTestSpecificAUSize, BluestoreTinyDevFailure2) { + if (string(GetParam()) != "bluestore") + return; + + // This caused assert in allocator as initial bluefs extent as slow device + // overlaped with superblock + // https://tracker.ceph.com/issues/24480 + SetVal(g_conf(), "bluestore_block_size", + stringify(1024 * 1024 * 1024).c_str()); //1 Gb + SetVal(g_conf(), "bluestore_block_db_size", + stringify(1024 * 1024 * 1024).c_str()); //1 Gb + SetVal(g_conf(), "bluestore_block_db_create", "true"); + SetVal(g_conf(), "bluestore_bluefs_min", + stringify(1024 * 1024 * 1024).c_str()); + StartDeferred(0x1000); + store->umount(); + ASSERT_EQ(store->fsck(false), 0); // do fsck explicitly + store->mount(); +} #endif // WITH_BLUESTORE int main(int argc, char **argv) { -- 2.39.5