Skip to content

Commit 2e3578b

Browse files
committed
test/store_test: add BlueFS reserved space tests
Signed-off-by: Igor Fedotov <[email protected]>
1 parent acdd0e3 commit 2e3578b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/test/objectstore/store_test.cc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11970,6 +11970,32 @@ TEST_P(StoreTestOmapUpgrade, LargeLegacyToPG) {
1197011970
}
1197111971
}
1197211972

11973+
TEST_P(StoreTestSpecificAUSize, BlueFSReservedTest) {
11974+
if (string(GetParam()) != "bluestore")
11975+
return;
11976+
11977+
uint64_t db_size = 1ull << 32; // 4GiB
11978+
uint64_t wal_extra = 0x10000;
11979+
uint64_t wal_size = db_size + wal_extra; // 4GiB + 64K
11980+
SetVal(g_conf(), "bluestore_block_db_create", "true");
11981+
SetVal(g_conf(), "bluestore_block_db_size", stringify(db_size).c_str());
11982+
SetVal(g_conf(), "bluestore_block_wal_create", "true");
11983+
SetVal(g_conf(), "bluestore_block_wal_size", stringify(wal_size).c_str());
11984+
11985+
g_conf().apply_changes(nullptr);
11986+
11987+
StartDeferred(65536);
11988+
BlueStore* bstore = dynamic_cast<BlueStore*> (store.get());
11989+
ceph_assert(bstore);
11990+
BlueFS* fs = bstore->get_bluefs();
11991+
11992+
ASSERT_EQ(fs->get_full_reserved(BlueFS::BDEV_DB),
11993+
g_conf()->bluefs_alloc_size);
11994+
11995+
ASSERT_EQ(fs->get_full_reserved(BlueFS::BDEV_WAL),
11996+
wal_extra);
11997+
}
11998+
1197311999
#endif // WITH_BLUESTORE
1197412000

1197512001
int main(int argc, char **argv) {

0 commit comments

Comments
 (0)