From: Jos Collin Date: Fri, 18 Oct 2024 12:39:41 +0000 (+0530) Subject: qa: reconfigure only the appropriate client auth caps X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ffbe1161185819233c1ac3bd7318ecb52063537b;p=ceph.git qa: reconfigure only the appropriate client auth caps * Fix _setup_fs to reconfigure only the appropriate client auth caps, by avoiding iterating the self.mounts. * Delete unused filesystems in test_perf_stats_stale_metrics_with_multiple_filesystem. Signed-off-by: Jos Collin (cherry picked from commit 7ac14cac91c73779d480d42c38f4f99524ceedd7) --- diff --git a/qa/tasks/cephfs/test_mds_metrics.py b/qa/tasks/cephfs/test_mds_metrics.py index 0e824d3d278dc..ffece497cb30d 100644 --- a/qa/tasks/cephfs/test_mds_metrics.py +++ b/qa/tasks/cephfs/test_mds_metrics.py @@ -105,7 +105,7 @@ class TestMDSMetrics(CephFSTestCase): break return done, metrics - def _setup_fs(self, fs_name): + def _setup_fs(self, fs_name, client_id): fs_a = self.mds_cluster.newfs(name=fs_name) self.mds_cluster.mds_restart() @@ -114,12 +114,11 @@ class TestMDSMetrics(CephFSTestCase): fs_a.wait_for_daemons() # Reconfigure client auth caps - for mount in self.mounts: - self.get_ceph_cmd_result( - 'auth', 'caps', f"client.{mount.client_id}", - 'mds', 'allow', - 'mon', 'allow r', - 'osd', f'allow rw pool={fs_a.get_data_pool_name()}') + self.get_ceph_cmd_result( + 'auth', 'caps', f"client.{client_id}", + 'mds', 'allow', + 'mon', 'allow r', + 'osd', f'allow rw pool={fs_a.get_data_pool_name()}') return fs_a @@ -505,7 +504,7 @@ class TestMDSMetrics(CephFSTestCase): "true", "--yes-i-really-mean-it") # creating filesystem - fs_a = self._setup_fs(fs_name="fs1") + fs_a = self._setup_fs(fs_name="fs1", client_id=self.mount_a.client_id) # Mount a client on fs_a self.mount_a.mount_wait(cephfs_name=fs_a.name) @@ -515,7 +514,7 @@ class TestMDSMetrics(CephFSTestCase): self.mount_a.create_files() # creating another filesystem - fs_b = self._setup_fs(fs_name="fs2") + fs_b = self._setup_fs(fs_name="fs2", client_id=self.mount_b.client_id) # Mount a client on fs_b self.mount_b.mount_wait(cephfs_name=fs_b.name) @@ -568,12 +567,13 @@ class TestMDSMetrics(CephFSTestCase): def test_perf_stats_stale_metrics_with_multiple_filesystem(self): self.mount_a.umount_wait() self.mount_b.umount_wait() + self.fs.delete_all_filesystems() self.run_ceph_cmd("fs", "flag", "set", "enable_multiple", "true", "--yes-i-really-mean-it") # creating filesystem - fs_b = self._setup_fs(fs_name="fs2") + fs_b = self._setup_fs(fs_name="fs2", client_id=self.mount_b.client_id) # Mount a client on fs_b self.mount_b.mount_wait(cephfs_name=fs_b.name) @@ -582,7 +582,7 @@ class TestMDSMetrics(CephFSTestCase): self.mount_b.create_files() # creating another filesystem - fs_a = self._setup_fs(fs_name="fs1") + fs_a = self._setup_fs(fs_name="fs1", client_id=self.mount_a.client_id) # Mount a client on fs_a self.mount_a.mount_wait(cephfs_name=fs_a.name)