]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/onode-staged-tree: add option IS_DUMMY_SYNC to tests
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 15 Oct 2020 12:05:36 +0000 (20:05 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Tue, 1 Dec 2020 04:50:54 +0000 (12:50 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/test/crimson/seastore/onode_tree/test_staged_fltree.cc

index e782192ab40bdfb71338573086ed74a90143cc8f..72c2a9990feb9c3432bb5e18096ef3901f8bf8ec 100644 (file)
@@ -28,6 +28,8 @@ using seastore::segment_manager::DEFAULT_TEST_EPHEMERAL;
 using sc_config_t = seastore::SegmentCleaner::config_t;
 
 namespace {
+  constexpr bool IS_DUMMY_SYNC = false;
+
   [[maybe_unused]] seastar::logger& logger() {
     return crimson::get_logger(ceph_subsys_test);
   }
@@ -133,7 +135,7 @@ TEST_F(a_basic_test_t, 1_basic_sizes)
 TEST_F(a_basic_test_t, 2_node_sizes)
 {
   run_async([this] {
-    auto nm = NodeExtentManager::create_dummy(false);
+    auto nm = NodeExtentManager::create_dummy(IS_DUMMY_SYNC);
     auto t = make_transaction();
     context_t c{*nm, *t};
     std::array<std::pair<NodeImplURef, NodeExtentMutable>, 16> nodes = {
@@ -173,7 +175,7 @@ struct b_dummy_tree_test_t : public seastar_test_suite_t {
   Btree tree;
 
   b_dummy_tree_test_t()
-    : moved_nm{NodeExtentManager::create_dummy(false)},
+    : moved_nm{NodeExtentManager::create_dummy(IS_DUMMY_SYNC)},
       ref_t{make_transaction()},
       t{*ref_t},
       c{*moved_nm, t},
@@ -370,7 +372,7 @@ static std::set<ghobject_t> build_key_set(
 class TestTree {
  public:
   TestTree()
-    : moved_nm{NodeExtentManager::create_dummy(false)},
+    : moved_nm{NodeExtentManager::create_dummy(IS_DUMMY_SYNC)},
       ref_t{make_transaction()},
       t{*ref_t},
       c{*moved_nm, t},
@@ -424,7 +426,7 @@ class TestTree {
   seastar::future<> split(const ghobject_t& key, const onode_t& value,
                           const split_expectation_t& expected) {
     return seastar::async([this, key, &value, expected] {
-      Btree tree_clone(NodeExtentManager::create_dummy(false));
+      Btree tree_clone(NodeExtentManager::create_dummy(IS_DUMMY_SYNC));
       auto ref_t_clone = make_transaction();
       Transaction& t_clone = *ref_t_clone;
       tree_clone.test_clone_from(t_clone, t, tree).unsafe_get0();
@@ -837,7 +839,7 @@ class DummyChildPool {
     reset();
 
     // create tree
-    auto ref_nm = NodeExtentManager::create_dummy(false);
+    auto ref_nm = NodeExtentManager::create_dummy(IS_DUMMY_SYNC);
     p_nm = ref_nm.get();
     p_btree.emplace(std::move(ref_nm));
     return DummyChild::create_initial(get_context(), keys, *this, *p_btree->root_tracker
@@ -873,7 +875,7 @@ class DummyChildPool {
       logger().info("insert {} at {}:", key_hobj_t(key), pos);
       DummyChildPool pool_clone;
       pool_clone_in_progress = &pool_clone;
-      auto ref_nm = NodeExtentManager::create_dummy(false);
+      auto ref_nm = NodeExtentManager::create_dummy(IS_DUMMY_SYNC);
       pool_clone.p_nm = ref_nm.get();
       pool_clone.p_btree.emplace(std::move(ref_nm));
       pool_clone.p_btree->test_clone_from(
@@ -1173,7 +1175,7 @@ struct d_seastore_tree_test_t : public seastar_test_suite_t {
           {0, 32}, {0, 10}, {0, 4}),
       tree{kvs,
 #if 0
-        NodeExtentManager::create_dummy(false)
+        NodeExtentManager::create_dummy(IS_DUMMY_SYNC)
 #else
         NodeExtentManager::create_seastore(tm)
 #endif