]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: reconfigure only the appropriate client auth caps
authorJos Collin <jcollin@redhat.com>
Fri, 18 Oct 2024 12:39:41 +0000 (18:09 +0530)
committerJos Collin <jcollin@redhat.com>
Thu, 3 Jul 2025 13:06:32 +0000 (18:36 +0530)
* 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 <jcollin@redhat.com>
(cherry picked from commit 7ac14cac91c73779d480d42c38f4f99524ceedd7)

qa/tasks/cephfs/test_mds_metrics.py

index 0e824d3d278dc4392c550ce661ee6d513bc90c5d..ffece497cb30d5b94d83549f68aac184db14b828 100644 (file)
@@ -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)