]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/crimson/seastore: lack of config.inclusive==true situation in omap_manager list...
authorXinyu Huang <xinyu.huang@intel.com>
Wed, 7 Sep 2022 06:40:52 +0000 (06:40 +0000)
committerXinyu Huang <xinyu.huang@intel.com>
Wed, 7 Sep 2022 09:45:42 +0000 (09:45 +0000)
Signed-off-by: Xinyu Huang <xinyu.huang@intel.com>
src/test/crimson/seastore/test_omap_manager.cc

index 708f32415ee9ca25c96f7248d90f6c534ab4acaa..f485097df4129357f3c2feca5723f535a8f612a5 100644 (file)
@@ -141,7 +141,8 @@ struct omap_manager_test_t :
     const omap_root_t &omap_root,
     Transaction &t,
     const std::optional<std::string> &start,
-    size_t max = 128) {
+    size_t max = 128,
+    bool inclusive = false) {
 
     if (start) {
       logger().debug("list on {}", *start);
@@ -151,6 +152,7 @@ struct omap_manager_test_t :
 
     auto config = OMapManager::omap_list_config_t::with_max(max);
     config.max_result_size = max;
+    config.inclusive = inclusive;
 
     auto [complete, results] = with_trans_intr(
       t,
@@ -158,9 +160,14 @@ struct omap_manager_test_t :
        return omap_manager->omap_list(omap_root, t, start, config);
       }).unsafe_get0();
 
-    auto it = start ?
-      test_omap_mappings.upper_bound(*start) :
-      test_omap_mappings.begin();
+    test_omap_t::iterator it;
+    if (start) {
+      it = config.inclusive ?
+       test_omap_mappings.lower_bound(*start) :
+       test_omap_mappings.upper_bound(*start);
+    } else {
+      it = test_omap_mappings.begin();
+    }
     for (auto &&[k, v]: results) {
       EXPECT_NE(it, test_omap_mappings.end());
       if (it == test_omap_mappings.end())
@@ -398,6 +405,11 @@ TEST_F(omap_manager_test_t, force_split_listkeys_list_clear)
       list(omap_root, *t, temp, 100);
     }
 
+    {
+      auto t = create_read_transaction();
+      list(omap_root, *t, temp, 100, true);
+    }
+
     {
       auto t = create_mutate_transaction();
       clear(omap_root, *t);
@@ -431,6 +443,11 @@ TEST_F(omap_manager_test_t, force_inner_node_split_list)
       list(omap_root, *t, temp, 10240);
     }
 
+    {
+      auto t = create_read_transaction();
+      list(omap_root, *t, temp, 10240, true);
+    }
+
     {
       auto t = create_mutate_transaction();
       clear(omap_root, *t);