]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: 'enable experimental data corrupting features' now understands '*' 5704/head
authorKefu Chai <kchai@redhat.com>
Fri, 28 Aug 2015 16:08:10 +0000 (00:08 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 28 Aug 2015 16:15:01 +0000 (00:15 +0800)
'*' allows any feature.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/ceph_context.cc
src/test/common/test_context.cc

index 877dd539284ca0d86ea6c5f07cfe66060232d020..ff7bf2bf0e6b31cb5941dac90461ab2a16fd4893 100644 (file)
@@ -230,7 +230,8 @@ bool CephContext::check_experimental_feature_enabled(const std::string& feat,
                                                     std::ostream *message)
 {
   ceph_spin_lock(&_feature_lock);
-  bool enabled = _experimental_features.count(feat);
+  bool enabled = (_experimental_features.count(feat) ||
+                 _experimental_features.count("*"));
   ceph_spin_unlock(&_feature_lock);
 
   if (enabled) {
index c32fed30b32260142cea001152159b36f30a9511..921fc90ff5fa6bcd3764fbc034ccc09a49b1d017 100644 (file)
@@ -82,6 +82,13 @@ TEST(CephContext, experimental_features)
   ASSERT_FALSE(cct->check_experimental_feature_enabled("bar"));
   ASSERT_TRUE(cct->check_experimental_feature_enabled("baz"));
 
+  cct->_conf->set_val("enable_experimental_unrecoverable_data_corrupting_features",
+                     "*");
+  cct->_conf->apply_changes(&cout);
+  ASSERT_TRUE(cct->check_experimental_feature_enabled("foo"));
+  ASSERT_TRUE(cct->check_experimental_feature_enabled("bar"));
+  ASSERT_TRUE(cct->check_experimental_feature_enabled("baz"));
+
   cct->_log->flush();
 }