]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: fix test_multifs_single_path_rootsquash 56846/head
authorRishabh Dave <ridave@redhat.com>
Thu, 11 Apr 2024 18:12:18 +0000 (23:42 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 3 May 2024 08:03:30 +0000 (13:33 +0530)
test_multifs_single_path_rootsquash was never run with vstart_runner.py
or with teuthology and is therefore full of bugs. Fix it to make sure it
runs fine.

Introduced-by: 1fda8ed2d4a9
Fixes: https://tracker.ceph.com/issues/65246
Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/cephfs/test_admin.py

index 0afe76c7882eec1fc89ef64586a404990f2b4eeb..79ad2737895f7d5872d225f80c1c6b1393d0d0d0 100644 (file)
@@ -1415,34 +1415,36 @@ class TestFsAuthorize(CephFSTestCase):
         self.fs1 = self.fs
         self.fs2 = self.mds_cluster.newfs('testcephfs2')
         self.mount_b.remount(cephfs_name=self.fs2.name)
-        self.captesters = (CapTester(self.mount_a), CapTester(self.mount_b))
+        self.captester1 = CapTester(self.mount_a)
+        self.captester2 = CapTester(self.mount_b)
 
-        # Authorize client to fs1
         PERM = 'rw'
         FS_AUTH_CAPS = (('/', PERM, 'root_squash'),)
-        self.captester = CapTester(self.mount_a, '/')
-        self.fs1.authorize(self.client_id, FS_AUTH_CAPS)
 
-        # Authorize client to fs2
+        self.fs1.authorize(self.client_id, FS_AUTH_CAPS)
         self.fs2.authorize(self.client_id, FS_AUTH_CAPS)
         keyring = self.fs.mon_manager.get_keyring(self.client_id)
 
-        self._remount(self.mount_a, self.fs1.name, keyring)
-        self._remount(self.mount_b, self.fs2.name, keyring)
+        keyring_path = self.mount_a.client_remote.mktemp(data=keyring)
+        self.mount_a.remount(client_id=self.client_id,
+                             client_keyring_path=keyring_path)
         # testing MDS caps...
         # Since root_squash is set in client caps, client can read but not
         # write even though access level is set to "rw" on both fses
-        self.captester[0].conduct_pos_test_for_read_caps()
-        self.captester[0].conduct_pos_test_for_open_caps()
-        self.captester[0].conduct_neg_test_for_write_caps(sudo_write=True)
-        self.captester[0].conduct_neg_test_for_chown_caps()
-        self.captester[0].conduct_neg_test_for_truncate_caps()
-
-        self.captester[1].conduct_pos_test_for_read_caps()
-        self.captester[1].conduct_pos_test_for_open_caps()
-        self.captester[1].conduct_neg_test_for_write_caps(sudo_write=True)
-        self.captester[1].conduct_neg_test_for_chown_caps()
-        self.captester[1].conduct_neg_test_for_truncate_caps()
+        self.captester1.conduct_pos_test_for_read_caps()
+        self.captester1.conduct_pos_test_for_open_caps()
+        self.captester1.conduct_neg_test_for_write_caps(sudo_write=True)
+        self.captester1.conduct_neg_test_for_chown_caps()
+        self.captester1.conduct_neg_test_for_truncate_caps()
+
+        keyring_path = self.mount_b.client_remote.mktemp(data=keyring)
+        self.mount_b.remount(client_id=self.client_id,
+                             client_keyring_path=keyring_path)
+        self.captester2.conduct_pos_test_for_read_caps()
+        self.captester2.conduct_pos_test_for_open_caps()
+        self.captester2.conduct_neg_test_for_write_caps(sudo_write=True)
+        self.captester2.conduct_neg_test_for_chown_caps()
+        self.captester2.conduct_neg_test_for_truncate_caps()
 
     def test_single_path_rootsquash_issue_56067(self):
         """