From b9ce1df075b60b3f1ca3ae4b3ff4f431fa570649 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 30 Jan 2016 13:56:21 -0500 Subject: [PATCH] unittest_config: cope with $data_dir not being expanded on non-daemons Signed-off-by: Sage Weil --- src/test/common/test_config.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/common/test_config.cc b/src/test/common/test_config.cc index 5f3bc3f3674ed..328626744ea43 100644 --- a/src/test/common/test_config.cc +++ b/src/test/common/test_config.cc @@ -112,13 +112,15 @@ public: void test_expand_all_meta() { Mutex::Locker l(lock); - int before_count = 0; + int before_count = 0, data_dir = 0; for (int i = 0; i < NUM_CONFIG_OPTIONS; i++) { config_option *opt = config_optionsp + i; if (opt->type == OPT_STR) { std::string *str = (std::string *)opt->conf_ptr(this); if (str->find("$") != string::npos) before_count++; + if (str->find("$data_dir") != string::npos) + data_dir++; } } // if there are no meta variables in the default configuration, @@ -143,7 +145,7 @@ public: } } } - ASSERT_EQ(0, after_count); + ASSERT_EQ(data_dir, after_count); } }; -- 2.39.5