]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
seastore/test_transaction_manager: add a test which forces an lba split
authorSamuel Just <sjust@redhat.com>
Tue, 7 Jul 2020 22:44:04 +0000 (15:44 -0700)
committerSamuel Just <sjust@redhat.com>
Mon, 13 Jul 2020 17:48:34 +0000 (10:48 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/test/crimson/seastore/test_transaction_manager.cc

index 5c6cccbebefafe7f22e32580970c693d7de0c9b5..d086c4ca34818b3970db098bc2492b92861ace63 100644 (file)
@@ -324,3 +324,21 @@ TEST_F(transaction_manager_test_t, inc_dec_ref)
     }
   });
 }
+
+TEST_F(transaction_manager_test_t, cause_lba_split)
+{
+  constexpr laddr_t SIZE = 4096;
+  run_async([this] {
+    for (unsigned i = 0; i < 200; ++i) {
+      auto t = create_transaction();
+      auto extent = alloc_extent(
+       t,
+       i * SIZE,
+       SIZE,
+       (char)(i & 0xFF));
+      ASSERT_EQ(i * SIZE, extent->get_laddr());
+      submit_transaction(std::move(t));
+    }
+    check_mappings();
+  });
+}