]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/crimson/seastore/rbm: use normal initialization path instead of open and set_blo... 50085/head
authormyoungwon oh <ohmyoungwon@gmail.com>
Sat, 25 Feb 2023 01:31:31 +0000 (10:31 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Sat, 25 Feb 2023 04:19:20 +0000 (13:19 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/crimson/os/seastore/random_block_manager/rbm_device.h
src/test/crimson/seastore/nvmedevice/test_nvmedevice.cc

index 0122b2773bec467c8bb9121a53806f228fb3dc14..7f30b197f3a5362f12eefd6d3f0536f4dd09d36e 100644 (file)
@@ -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<RBMDevice>;
 
index 21aebcd8e8db5b26eba8cc659dc6791021b8b522..14b241830749e3080ad90bd089c9a004e102e0a5 100644 (file)
@@ -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_t>(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();