]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os: ObjectStore::collect_metadata unit tests
authorLoic Dachary <loic@dachary.org>
Sat, 24 May 2014 10:52:30 +0000 (12:52 +0200)
committerLoic Dachary <loic@dachary.org>
Wed, 28 May 2014 09:43:37 +0000 (11:43 +0200)
And an emacs-executable reminder about how to run a specific test.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/objectstore/store_test.cc

index ca9683b9385d7bb2503fce1c4ca54543b14546d5..76c1141b4b1a7907560e99d3c327b619a1c4f10a 100644 (file)
@@ -75,6 +75,15 @@ bool sorted(const vector<ghobject_t> &in) {
   return true;
 }
 
+TEST_P(StoreTest, collect_metadata) {
+  map<string,string> 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:
+ */