]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: Fix validation of client_version
authorKotresh HR <khiremat@redhat.com>
Thu, 26 Jun 2025 07:44:00 +0000 (07:44 +0000)
committerKotresh HR <khiremat@redhat.com>
Thu, 17 Jul 2025 06:45:52 +0000 (06:45 +0000)
The multifs auth caps bug has a fix both in client and mds.
If it's old client and not patched, we expect that the fs
with 'rw' would end up having 'r' caps with the multifs
auth caps used as in the test
'test_multifs_single_client_cross_access_r_caps_end'.
This patch adds the conditional to validate the same.

This commit makes use of the PR #64005

Fixes: https://tracker.ceph.com/issues/72167
Signed-off-by: Kotresh HR <khiremat@redhat.com>
qa/tasks/cephfs/test_admin.py

index 5f2488cbff08a50a29d38b4f3b4f36d9fc888c6c..007e1f4e0e6d9f92221d8c9a9b664209314ac9e4 100644 (file)
@@ -1812,16 +1812,30 @@ class TestFsAuthorize(CephFSTestCase):
         keyring_path = self.mount_b.client_remote.mktemp(data=keyring)
         self.mount_b.remount(client_id=self.client_id, client_keyring_path=keyring_path, cephfs_name=self.fs2.name)
 
-        # Client on fs1 - validate 'rw' access
-        captester_fs1_rw.conduct_pos_test_for_read_caps()
-        captester_fs1_rw.conduct_pos_test_for_write_caps()
-        captester_fs1_rw.conduct_pos_test_for_new_file_creation()
-
         # Client on fs2 should not have 'rw' access
         captester_fs2_r.conduct_pos_test_for_read_caps()
         captester_fs2_r.conduct_neg_test_for_write_caps()
         captester_fs2_r.conduct_neg_test_for_new_file_creation()
 
+        # Client on fs1 - validate 'rw' access
+        ceph_client_version = None
+        tasks = self.ctx.config.get('tasks', [])
+        for task in tasks:
+            if task.get("install", None):
+                ceph_client_version = task.get("install").get("tag", None)
+                break
+
+        log.info(f"dumping ceph_client_version - {ceph_client_version}")
+        captester_fs1_rw.conduct_pos_test_for_read_caps()
+        # The multifs auth caps bug has a fix both in client and mds
+        # If it's old client (19.2.2) and not patched, we expect that the fs
+        # with 'rw' would end up having 'r' caps with the multifs for
+        # auth caps used as in this test above.
+        if ceph_client_version != "v19.2.2":
+            captester_fs1_rw.conduct_pos_test_for_write_caps()
+            captester_fs1_rw.conduct_pos_test_for_new_file_creation()
+
+
     def test_multifs_rootsquash_nofeature(self):
         """
         That having root_squash on one fs doesn't prevent access to others.