Skip to content

Commit 04416f4

Browse files
Merge pull request ceph#56846 from rishabh-d-dave/test-fs-auth
qa/cephfs: fix and improve test_multifs_single_path_rootsquash Reviewed-by: Venky Shankar <[email protected]> Reviewed-by: Xiubo Li <[email protected]>
2 parents 9a41cd7 + d9752a6 commit 04416f4

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

qa/tasks/cephfs/test_admin.py

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,38 +1447,36 @@ def test_multifs_single_path_rootsquash(self):
14471447
self.fs1 = self.fs
14481448
self.fs2 = self.mds_cluster.newfs('testcephfs2')
14491449
self.mount_b.remount(cephfs_name=self.fs2.name)
1450-
self.captesters = (CapTester(self.mount_a), CapTester(self.mount_b))
1451-
1452-
if not isinstance(self.mount_a, FuseMount):
1453-
self.skipTest("only FUSE client has CEPHFS_FEATURE_MDS_AUTH_CAPS "
1454-
"needed to enforce root_squash MDS caps")
1450+
self.captester1 = CapTester(self.mount_a)
1451+
self.captester2 = CapTester(self.mount_b)
14551452

1456-
# Authorize client to fs1
14571453
PERM = 'rw'
14581454
FS_AUTH_CAPS = (('/', PERM, 'root_squash'),)
1459-
self.captester = CapTester(self.mount_a, '/')
1460-
self.fs1.authorize(self.client_id, FS_AUTH_CAPS)
14611455

1462-
# Authorize client to fs2
1456+
self.fs1.authorize(self.client_id, FS_AUTH_CAPS)
14631457
self.fs2.authorize(self.client_id, FS_AUTH_CAPS)
14641458
keyring = self.fs.mon_manager.get_keyring(self.client_id)
14651459

1466-
self._remount(self.mount_a, self.fs1.name, keyring)
1467-
self._remount(self.mount_b, self.fs2.name, keyring)
1460+
keyring_path = self.mount_a.client_remote.mktemp(data=keyring)
1461+
self.mount_a.remount(client_id=self.client_id,
1462+
client_keyring_path=keyring_path)
14681463
# testing MDS caps...
14691464
# Since root_squash is set in client caps, client can read but not
14701465
# write even though access level is set to "rw" on both fses
1471-
self.captester[0].conduct_pos_test_for_read_caps()
1472-
self.captester[0].conduct_pos_test_for_open_caps()
1473-
self.captester[0].conduct_neg_test_for_write_caps(sudo_write=True)
1474-
self.captester[0].conduct_neg_test_for_chown_caps()
1475-
self.captester[0].conduct_neg_test_for_truncate_caps()
1476-
1477-
self.captester[1].conduct_pos_test_for_read_caps()
1478-
self.captester[1].conduct_pos_test_for_open_caps()
1479-
self.captester[1].conduct_neg_test_for_write_caps(sudo_write=True)
1480-
self.captester[1].conduct_neg_test_for_chown_caps()
1481-
self.captester[1].conduct_neg_test_for_truncate_caps()
1466+
self.captester1.conduct_pos_test_for_read_caps()
1467+
self.captester1.conduct_pos_test_for_open_caps()
1468+
self.captester1.conduct_neg_test_for_write_caps(sudo_write=True)
1469+
self.captester1.conduct_neg_test_for_chown_caps()
1470+
self.captester1.conduct_neg_test_for_truncate_caps()
1471+
1472+
keyring_path = self.mount_b.client_remote.mktemp(data=keyring)
1473+
self.mount_b.remount(client_id=self.client_id,
1474+
client_keyring_path=keyring_path)
1475+
self.captester2.conduct_pos_test_for_read_caps()
1476+
self.captester2.conduct_pos_test_for_open_caps()
1477+
self.captester2.conduct_neg_test_for_write_caps(sudo_write=True)
1478+
self.captester2.conduct_neg_test_for_chown_caps()
1479+
self.captester2.conduct_neg_test_for_truncate_caps()
14821480

14831481
def test_single_path_rootsquash_issue_56067(self):
14841482
"""

0 commit comments

Comments
 (0)