From: myoungwon oh Date: Sat, 25 Feb 2023 01:31:31 +0000 (+0900) Subject: test/crimson/seastore/rbm: use normal initialization path instead of open and set_blo... X-Git-Tag: v18.1.0~271^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F50085%2Fhead;p=ceph.git test/crimson/seastore/rbm: use normal initialization path instead of open and set_block_size for test Signed-off-by: Myoungwon Oh --- diff --git a/src/crimson/os/seastore/random_block_manager/rbm_device.h b/src/crimson/os/seastore/random_block_manager/rbm_device.h index 0122b2773bec..7f30b197f3a5 100644 --- a/src/crimson/os/seastore/random_block_manager/rbm_device.h +++ b/src/crimson/os/seastore/random_block_manager/rbm_device.h @@ -171,11 +171,6 @@ public: static rbm_abs_addr get_journal_start() { return RBM_SUPERBLOCK_SIZE; } - - // interfaces for test - void set_block_size(size_t size) { - super.block_size = size; - } }; using RBMDeviceRef = std::unique_ptr; diff --git a/src/test/crimson/seastore/nvmedevice/test_nvmedevice.cc b/src/test/crimson/seastore/nvmedevice/test_nvmedevice.cc index 21aebcd8e8db..14b241830749 100644 --- a/src/test/crimson/seastore/nvmedevice/test_nvmedevice.cc +++ b/src/test/crimson/seastore/nvmedevice/test_nvmedevice.cc @@ -52,12 +52,23 @@ WRITE_CLASS_DENC_BOUNDED( nvdev_test_block_t ) +using crimson::common::local_conf; TEST_F(nvdev_test_t, write_and_verify_test) { run_async([this] { - device.reset(new random_block_device::nvme::NVMeBlockDevice("")); - device->open(dev_path, seastar::open_flags::rw).unsafe_get(); - device->set_block_size(BLK_SIZE); + device.reset(new random_block_device::nvme::NVMeBlockDevice(dev_path)); + local_conf().set_val("seastore_cbjournal_size", "1000000").get(); + device->mkfs( + device_config_t{ + true, + device_spec_t{ + (magic_t)std::rand(), + device_type_t::RANDOM_BLOCK_SSD, + static_cast(DEVICE_ID_RANDOM_BLOCK_MIN)}, + seastore_meta_t{uuid_d()}, + secondary_device_set_t()} + ).unsafe_get(); + device->mount().unsafe_get(); nvdev_test_block_t original_data; std::minstd_rand0 generator; uint8_t value = generator();