]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/crimson/seastore: add test profile for full integrity check 55449/head
authorXuehan Xu <xuxuehan@qianxin.com>
Wed, 20 Mar 2024 07:12:28 +0000 (15:12 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Mon, 22 Apr 2024 10:24:02 +0000 (18:24 +0800)
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/test/crimson/seastore/onode_tree/test_fltree_onode_manager.cc
src/test/crimson/seastore/onode_tree/test_staged_fltree.cc
src/test/crimson/seastore/test_collection_manager.cc
src/test/crimson/seastore/test_object_data_handler.cc
src/test/crimson/seastore/test_omap_manager.cc
src/test/crimson/seastore/test_seastore.cc
src/test/crimson/seastore/test_transaction_manager.cc
src/test/crimson/seastore/transaction_manager_test_state.h

index 92ab147ef89b158d24c2e7be5b091b6414b96053..dd6c88dcf405d540cb8183e1fbe3f26ded0bdf64 100644 (file)
@@ -318,8 +318,12 @@ TEST_P(fltree_onode_manager_test_t, 2_synthetic)
 INSTANTIATE_TEST_SUITE_P(
   fltree_onode__manager_test,
   fltree_onode_manager_test_t,
-  ::testing::Values (
-    "segmented",
-    "circularbounded"
+  ::testing::Combine(
+    ::testing::Values (
+      "segmented",
+      "circularbounded"
+    ),
+    ::testing::Values(
+      integrity_check_t::FULL_CHECK)
   )
 );
index 7357b5ced1ed1a7b8be8e2ca42ba521fdefe83f3..5521d52799d6e39666ccbe43b3a49e586294c16d 100644 (file)
@@ -1785,8 +1785,12 @@ TEST_P(d_seastore_tm_test_t, 7_tree_insert_erase_eagain)
 INSTANTIATE_TEST_SUITE_P(
   d_seastore_tm_test,
   d_seastore_tm_test_t,
-  ::testing::Values (
-    "segmented",
-    "circularbounded"
+  ::testing::Combine(
+    ::testing::Values (
+      "segmented",
+      "circularbounded"
+    ),
+    ::testing::Values(
+      integrity_check_t::FULL_CHECK)
   )
 );
index cedcc5e8f4418fddc83d472082e500a0132a334e..92770b67d159c8daa071cd307c7caa41349a1ab7 100644 (file)
@@ -188,8 +188,12 @@ TEST_P(collection_manager_test_t, update)
 INSTANTIATE_TEST_SUITE_P(
   collection_manager_test,
   collection_manager_test_t,
-  ::testing::Values (
-    "segmented",
-    "circularbounded"
+  ::testing::Combine(
+    ::testing::Values (
+      "segmented",
+      "circularbounded"
+    ),
+    ::testing::Values(
+      integrity_check_t::FULL_CHECK)
   )
 );
index 2fab7b22ece1525e14d7cbbfdfe62e4264629ce2..a693e54bb917cb0009490264964eac3b081bcf55 100644 (file)
@@ -776,6 +776,7 @@ TEST_P(object_data_handler_test_t, random_overwrite) {
 
 TEST_P(object_data_handler_test_t, overwrite_then_read_within_transaction) {
   run_async([this] {
+    disable_max_extent_size();
     enable_delta_based_overwrite();
     auto t = create_mutate_transaction();
     auto base = 4096 * 4;
@@ -857,14 +858,20 @@ TEST_P(object_data_handler_test_t, overwrite_then_read_within_transaction) {
     EXPECT_EQ(committed.length(), pending.length());
     EXPECT_NE(committed, pending);
     disable_delta_based_overwrite();
+    enable_max_extent_size();
   });
 }
 
 INSTANTIATE_TEST_SUITE_P(
   object_data_handler_test,
   object_data_handler_test_t,
-  ::testing::Values (
-    "segmented",
-    "circularbounded"
+  ::testing::Combine(
+    ::testing::Values (
+      "segmented",
+      "circularbounded"
+    ),
+    ::testing::Values(
+      integrity_check_t::FULL_CHECK,
+      integrity_check_t::NONFULL_CHECK)
   )
 );
index ab2218565f8ac4d44da1d8eb5cbe5d6f7c7e7c6b..3811dc4ac4bc9071fef2b3787cca9fa49797465e 100644 (file)
@@ -723,8 +723,12 @@ TEST_P(omap_manager_test_t, internal_force_split_to_root)
 INSTANTIATE_TEST_SUITE_P(
   omap_manager_test,
   omap_manager_test_t,
-  ::testing::Values (
-    "segmented",
-    "circularbounded"
+  ::testing::Combine(
+    ::testing::Values (
+      "segmented",
+      "circularbounded"
+    ),
+    ::testing::Values(
+      integrity_check_t::FULL_CHECK)
   )
 );
index 4d671cebd5b81a34d2242af2cf50573871648cd6..e0d01bc2b4baa661b6a1436713bead704868cd7b 100644 (file)
@@ -1280,8 +1280,13 @@ TEST_P(seastore_test_t, zero)
 INSTANTIATE_TEST_SUITE_P(
   seastore_test,
   seastore_test_t,
-  ::testing::Values (
-    "segmented",
-    "circularbounded"
+  ::testing::Combine(
+    ::testing::Values (
+      "segmented",
+      "circularbounded"
+    ),
+    ::testing::Values(
+      integrity_check_t::FULL_CHECK,
+      integrity_check_t::NONFULL_CHECK)
   )
 );
index f4ec9f70703abba258f9361223c0f5223be25cda..901645317a7282e1e7b0bdaa0b36a340254e55b1 100644 (file)
@@ -1736,6 +1736,12 @@ struct tm_single_device_test_t :
   tm_single_device_test_t() : transaction_manager_test_t(1, 0) {}
 };
 
+struct tm_single_device_intergrity_check_test_t :
+  public transaction_manager_test_t {
+
+  tm_single_device_intergrity_check_test_t() : transaction_manager_test_t(1, 0) {}
+};
+
 struct tm_multi_device_test_t :
   public transaction_manager_test_t {
 
@@ -2120,7 +2126,7 @@ TEST_P(tm_single_device_test_t, find_hole_assert_trigger)
   });
 }
 
-TEST_P(tm_single_device_test_t, remap_lazy_read) 
+TEST_P(tm_single_device_intergrity_check_test_t, remap_lazy_read)
 {
   constexpr laddr_t offset = 0;
   constexpr size_t length = 256 << 10;
@@ -2186,12 +2192,12 @@ TEST_P(tm_single_device_test_t, parallel_extent_read)
   test_parallel_extent_read();
 }
 
-TEST_P(tm_single_device_test_t, test_remap_pin)
+TEST_P(tm_single_device_intergrity_check_test_t, test_remap_pin)
 {
   test_remap_pin();
 }
 
-TEST_P(tm_single_device_test_t, test_clone_and_remap_pin)
+TEST_P(tm_single_device_intergrity_check_test_t, test_clone_and_remap_pin)
 {
   test_clone_and_remap_pin();
 }
@@ -2201,7 +2207,7 @@ TEST_P(tm_single_device_test_t, test_overwrite_pin)
   test_overwrite_pin();
 }
 
-TEST_P(tm_single_device_test_t, test_remap_pin_concurrent)
+TEST_P(tm_single_device_intergrity_check_test_t, test_remap_pin_concurrent)
 {
   test_remap_pin_concurrent();
 }
@@ -2214,32 +2220,62 @@ TEST_P(tm_single_device_test_t, test_overwrite_pin_concurrent)
 INSTANTIATE_TEST_SUITE_P(
   transaction_manager_test,
   tm_single_device_test_t,
-  ::testing::Values (
-    "segmented",
-    "circularbounded"
+  ::testing::Combine(
+    ::testing::Values (
+      "segmented",
+      "circularbounded"
+    ),
+    ::testing::Values(
+      integrity_check_t::NONFULL_CHECK)
+  )
+);
+
+INSTANTIATE_TEST_SUITE_P(
+  transaction_manager_test,
+  tm_single_device_intergrity_check_test_t,
+  ::testing::Combine(
+    ::testing::Values (
+      "segmented",
+      "circularbounded"
+    ),
+    ::testing::Values(
+      integrity_check_t::FULL_CHECK,
+      integrity_check_t::NONFULL_CHECK)
   )
 );
 
 INSTANTIATE_TEST_SUITE_P(
   transaction_manager_test,
   tm_multi_device_test_t,
-  ::testing::Values (
-    "segmented"
+  ::testing::Combine(
+    ::testing::Values (
+      "segmented"
+    ),
+    ::testing::Values(
+      integrity_check_t::NONFULL_CHECK)
   )
 );
 
 INSTANTIATE_TEST_SUITE_P(
   transaction_manager_test,
   tm_multi_tier_device_test_t,
-  ::testing::Values (
-    "segmented"
+  ::testing::Combine(
+    ::testing::Values (
+      "segmented"
+    ),
+    ::testing::Values(
+      integrity_check_t::NONFULL_CHECK)
   )
 );
 
 INSTANTIATE_TEST_SUITE_P(
   transaction_manager_test,
   tm_random_block_device_test_t,
-  ::testing::Values (
-    "circularbounded"
+  ::testing::Combine(
+    ::testing::Values (
+      "circularbounded"
+    ),
+    ::testing::Values(
+      integrity_check_t::NONFULL_CHECK)
   )
 );
index 81200b1db7d976ac1872a1f3f3b05c2bd0dfbed8..054d22cb3237194a57b7ec434d954513902184e0 100644 (file)
@@ -26,6 +26,11 @@ using namespace crimson;
 using namespace crimson::os;
 using namespace crimson::os::seastore;
 
+enum class integrity_check_t : uint8_t {
+  FULL_CHECK,
+  NONFULL_CHECK
+};
+
 class EphemeralDevices {
 public:
   virtual seastar::future<> setup() = 0;
@@ -172,7 +177,8 @@ public:
 
 class EphemeralTestState 
 #ifdef UNIT_TESTS_BUILT
-  : public ::testing::WithParamInterface<const char*> {
+  : public ::testing::WithParamInterface<
+             std::tuple<const char*, integrity_check_t>> {
 #else 
   {
 #endif
@@ -220,7 +226,7 @@ protected:
   seastar::future<> tm_setup() {
     LOG_PREFIX(EphemeralTestState::tm_setup);
 #ifdef UNIT_TESTS_BUILT
-    std::string j_type = GetParam();
+    std::string j_type = std::get<0>(GetParam());
 #else
     std::string j_type = "segmented";
 #endif
@@ -277,11 +283,19 @@ protected:
   virtual seastar::future<> _init() override {
     auto sec_devices = devices->get_secondary_devices();
     auto p_dev = devices->get_primary_device();
+    auto fut = seastar::now();
+    if (std::get<1>(GetParam()) == integrity_check_t::FULL_CHECK) {
+      fut = crimson::common::local_conf().set_val(
+       "seastore_full_integrity_check", "true");
+    } else {
+      fut = crimson::common::local_conf().set_val(
+       "seastore_full_integrity_check", "false");
+    }
     tm = make_transaction_manager(p_dev, sec_devices, true);
     epm = tm->get_epm();
     lba_manager = tm->get_lba_manager();
     cache = tm->get_cache();
-    return seastar::now();
+    return fut;
   }
 
   virtual seastar::future<> _destroy() override {
@@ -421,10 +435,19 @@ protected:
   SeaStoreTestState() : EphemeralTestState(1, 0) {}
 
   virtual seastar::future<> _init() final {
+    auto fut = seastar::now();
+    if (std::get<1>(GetParam()) == integrity_check_t::FULL_CHECK) {
+      fut = crimson::common::local_conf().set_val(
+       "seastore_full_integrity_check", "true");
+    } else {
+      fut = crimson::common::local_conf().set_val(
+       "seastore_full_integrity_check", "false");
+    }
     seastore = make_test_seastore(
       std::make_unique<TestMDStoreState::Store>(mdstore_state.get_mdstore()));
-    return seastore->test_start(devices->get_primary_device_ref()
-    ).then([this] {
+    return fut.then([this] {
+      return seastore->test_start(devices->get_primary_device_ref());
+    }).then([this] {
       sharded_seastore = &(seastore->get_sharded_store());
     });
   }