From 9f26174122bd774c5efc5c51641f1ccb5d06e7c7 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Thu, 26 Jun 2025 07:44:00 +0000 Subject: [PATCH] qa: Fix validation of client_version 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 (cherry picked from commit f10e34d0350d216f02d4e73ec695340daae11dd4) Conflicts: qa/tasks/cephfs/test_admin.py - The commit 9d0ab233d822668e88c873bc1314e984feaf1296 is not backported --- qa/tasks/cephfs/test_admin.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/qa/tasks/cephfs/test_admin.py b/qa/tasks/cephfs/test_admin.py index c60df01e7c3..b2c3d0e78a0 100644 --- a/qa/tasks/cephfs/test_admin.py +++ b/qa/tasks/cephfs/test_admin.py @@ -1766,16 +1766,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 (18.2.6) 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 != "v18.2.6": + captester_fs1_rw.conduct_pos_test_for_write_caps() + captester_fs1_rw.conduct_pos_test_for_new_file_creation() + + def test_single_path_rootsquash_issue_56067(self): """ That a FS client using root squash MDS caps allows non-root user to write data -- 2.39.5