]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: fix large output in unittest_daemon_config 1052/head
authorLoic Dachary <loic@dachary.org>
Tue, 7 Jan 2014 15:49:44 +0000 (16:49 +0100)
committerLoic Dachary <loic@dachary.org>
Tue, 7 Jan 2014 15:51:51 +0000 (16:51 +0100)
All tests in daemon_config use the global g_ceph_context
object. Introducing an expansion loop in it will impact all tests and
generate a very large output.

Remove the SubstitutionLoop test case which is also covered in
test/common/test_config.cc.

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

index 54b334edf500b92e1f23dc076836708c646b254c..3e6dc4927e8b86df19fe185532eaaffe06001be2 100644 (file)
@@ -101,26 +101,6 @@ TEST(DaemonConfig, SubstitutionBracesTrailing) {
   ASSERT_EQ(string("barfoo"), string(buf));
 }
 
-TEST(DaemonConfig, SubstitutionLoop) {
-  int ret;
-  ret = g_ceph_context->_conf->set_val("internal_safe_to_start_threads", "false");
-  ret = g_ceph_context->_conf->set_val("host", "foo$public_network", false);
-  ASSERT_EQ(ret, 0);
-  ret = g_ceph_context->_conf->set_val("public_network", "bar$host", false);
-  ASSERT_EQ(ret, 0);
-  g_ceph_context->_conf->apply_changes(NULL);
-  char buf[128], buf2[128];
-  memset(buf, 0, sizeof(buf));
-  memset(buf2, 0, sizeof(buf2));
-  char *tmp = buf;
-  char *tmp2 = buf;
-  ret = g_ceph_context->_conf->get_val("host", &tmp, sizeof(buf));
-  ASSERT_EQ(ret, 0);
-  ret = g_ceph_context->_conf->get_val("public_network", &tmp2, sizeof(buf));
-  ASSERT_EQ(ret, 0);
-  ASSERT_TRUE(strchr(buf, '$') || strchr(buf2, '$'));
-}
-
 // config: variable substitution happen only once http://tracker.ceph.com/issues/7103
 TEST(DaemonConfig, SubstitutionMultiple) {
   int ret;