]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
reef: qa: do not use `fs authorize` for two fs
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 9 May 2024 01:38:56 +0000 (21:38 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 14 May 2024 15:50:05 +0000 (17:50 +0200)
This support was only recently added in squid.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 62328dfdf7aa834e5086080a7312b45439c2ebdf)

qa/tasks/cephfs/test_admin.py

index 53283a9c0e58483052e731b6f5cbab5e88de0051..db0e5660add04e445279677003e6e693684d410c 100644 (file)
@@ -1333,12 +1333,10 @@ class TestFsAuthorize(CephFSTestCase):
 
         self.mount_a.umount_wait()
 
-        # Authorize client to fs1
-        FS_AUTH_CAPS = (('/', 'rw'),)
-        self.fs1.authorize(self.client_id, FS_AUTH_CAPS)
-
-        FS_AUTH_CAPS = (('/', 'rw', 'root_squash'),)
-        keyring = self.fs2.authorize(self.client_id, FS_AUTH_CAPS)
+        self.run_ceph_cmd(f'auth caps client.{self.mount_a.client_id} '
+                          f'mon "allow r" '
+                          f'osd "allow rw tag cephfs data={self.fs1.name}, allow rw tag cephfs data={self.fs2.name}" '
+                          f'mds "allow rwp fsname={self.fs1.name}, allow rw fsname={self.fs2.name} root_squash"')
 
         CEPHFS_FEATURE_MDS_AUTH_CAPS_CHECK = 21
         # all but CEPHFS_FEATURE_MDS_AUTH_CAPS_CHECK
@@ -1347,12 +1345,7 @@ class TestFsAuthorize(CephFSTestCase):
 
         # should succeed
         with self.assert_cluster_log("report clients with broken root_squash", present=False):
-            keyring_path = self.mount_a.client_remote.mktemp(data=keyring)
-            self.mount_a.remount(client_id=self.client_id, client_keyring_path=keyring_path, mntargs=mntargs, cephfs_name=self.fs1.name)
-
-        captester = CapTester(self.mount_a, '/')
-        captester.conduct_pos_test_for_read_caps()
-        captester.conduct_pos_test_for_open_caps()
+            self.mount_a.remount(mntargs=mntargs, cephfs_name=self.fs1.name)
 
     def test_rootsquash_nofeature(self):
         """
@@ -1364,7 +1357,6 @@ class TestFsAuthorize(CephFSTestCase):
                           "needed to enforce root_squash MDS caps")
 
         self.mount_a.umount_wait()
-        self.mount_b.umount_wait()
 
         FS_AUTH_CAPS = (('/', 'rw', 'root_squash'),)
         keyring = self.fs.authorize(self.client_id, FS_AUTH_CAPS)
@@ -1394,7 +1386,6 @@ class TestFsAuthorize(CephFSTestCase):
                           "needed to enforce root_squash MDS caps")
 
         self.mount_a.umount_wait()
-        self.mount_b.umount_wait()
 
         FS_AUTH_CAPS = (('/', 'rw', 'root_squash'),)
         keyring = self.fs.authorize(self.client_id, FS_AUTH_CAPS)