From 3081652119ca9614623fcd21bdcf299f2102ed9b Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 24 May 2014 12:52:30 +0200 Subject: [PATCH] os: ObjectStore::collect_metadata unit tests And an emacs-executable reminder about how to run a specific test. Signed-off-by: Loic Dachary --- src/test/objectstore/store_test.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index ca9683b9385d7..76c1141b4b1a7 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -75,6 +75,15 @@ bool sorted(const vector &in) { return true; } +TEST_P(StoreTest, collect_metadata) { + map pm; + store->collect_metadata(&pm); + if (GetParam() == string("filestore")) { + ASSERT_NE(pm.count("filestore_backend"), 0); + ASSERT_NE(pm.count("filestore_f_type"), 0); + } +} + TEST_P(StoreTest, SimpleColTest) { coll_t cid = coll_t("initial"); int r = 0; @@ -1265,6 +1274,11 @@ int main(int argc, char **argv) { return RUN_ALL_TESTS(); } -// Local Variables: -// compile-command: "cd ../.. ; make ceph_test_objectstore ; ./ceph_test_objectstore --gtest_filter=StoreTest.* --log-to-stderr=true --debug-filestore=20" -// End: +/* + * Local Variables: + * compile-command: "cd ../.. ; make ceph_test_objectstore && + * ./ceph_test_objectstore \ + * --gtest_filter=*.collect_metadata* --log-to-stderr=true --debug-filestore=20 + * " + * End: + */ -- 2.39.5