From c85af7b14681be916cea1119f3f9cdf556e2707a Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Thu, 10 Aug 2017 10:28:09 -0700 Subject: [PATCH] qa: test that "fs new" correctly set the application_metadata Signed-off-by: Greg Farnum --- qa/tasks/cephfs/filesystem.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py index 0d3fc547b7e2b..dad3bd87b2654 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -453,6 +453,8 @@ class Filesystem(MDSCluster): data_pool_name, pgs_per_fs_pool.__str__()) self.mon_manager.raw_cluster_cmd('fs', 'new', self.name, self.metadata_pool_name, data_pool_name) + self.check_pool_application(self.metadata_pool_name) + self.check_pool_application(data_pool_name) # Turn off spurious standby count warnings from modifying max_mds in tests. try: self.mon_manager.raw_cluster_cmd('fs', 'set', self.name, 'standby_count_wanted', '0') @@ -465,6 +467,17 @@ class Filesystem(MDSCluster): self.getinfo(refresh = True) + + def check_pool_application(self, pool_name): + osd_map = self.mon_manager.get_osd_dump_json() + for pool in osd_map['pools']: + if pool['pool_name'] == pool_name: + if "application_metadata" in pool: + if not "cephfs" in pool['application_metadata']: + raise RuntimeError("Pool %p does not name cephfs as application!".\ + format(pool_name)) + + def __del__(self): if getattr(self._ctx, "filesystem", None) == self: delattr(self._ctx, "filesystem") -- 2.39.5