From: Joao Eduardo Luis Date: Tue, 26 Aug 2014 20:20:51 +0000 (+0100) Subject: test: common: test_config: whitelist '$channel' meta-variable X-Git-Tag: v0.86~167^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=06ec5ef5939ead876c0056e76fbbeebeb4878029;p=ceph.git test: common: test_config: whitelist '$channel' meta-variable Signed-off-by: Joao Eduardo Luis --- diff --git a/src/test/common/test_config.cc b/src/test/common/test_config.cc index cffdc763d711..5f3bc3f3674e 100644 --- a/src/test/common/test_config.cc +++ b/src/test/common/test_config.cc @@ -131,8 +131,16 @@ public: 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) - after_count++; + + size_t pos = 0; + while ((pos = str->find("$", pos)) != string::npos) { + if (str->substr(pos, 8) != "$channel") { + std::cout << "unexpected meta-variable found at pos " << pos + << " of '" << *str << "'" << std::endl; + after_count++; + } + pos++; + } } } ASSERT_EQ(0, after_count);