]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: common: test_config: whitelist '$channel' meta-variable 2118/head
authorJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 26 Aug 2014 20:20:51 +0000 (21:20 +0100)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Wed, 27 Aug 2014 18:12:15 +0000 (19:12 +0100)
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/test/common/test_config.cc

index cffdc763d711751f4057a7bf47b065acaa6c9033..5f3bc3f3674ed5ed2b320d4fb9940496640fd1bf 100644 (file)
@@ -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);