]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
unittest_config: cope with $data_dir not being expanded on non-daemons 7377/head
authorSage Weil <sage@redhat.com>
Sat, 30 Jan 2016 18:56:21 +0000 (13:56 -0500)
committerSage Weil <sage@redhat.com>
Thu, 4 Feb 2016 22:06:02 +0000 (17:06 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/test/common/test_config.cc

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