From: Igor Fedotov Date: Fri, 15 Jun 2018 10:48:03 +0000 (+0300) Subject: test/store_test: add test coverage for tiny device misuse. X-Git-Tag: v14.0.1~612^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ac6d07b245c9398fca620d33c606d91bd8c2e16d;p=ceph.git test/store_test: add test coverage for tiny device misuse. Signed-off-by: Igor Fedotov --- diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 0ce09665f691..47795b690fb7 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) {