mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
Merge PR #29355 into master
* refs/pull/29355/head: mgr/volumes: set uid/gid of FS client's mount as 0/0 Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
commit
a6066f4214
@ -157,6 +157,23 @@ class TestVolumes(CephFSTestCase):
|
||||
if ce.exitstatus != errno.ENOENT:
|
||||
raise
|
||||
|
||||
def test_default_uid_gid_subvolume(self):
|
||||
subvolume = self._generate_random_subvolume_name()
|
||||
expected_uid = 0
|
||||
expected_gid = 0
|
||||
|
||||
# create subvolume
|
||||
self._fs_cmd("subvolume", "create", self.volname, subvolume)
|
||||
subvol_path = self._get_subvolume_path(self.volname, subvolume)
|
||||
|
||||
# check subvolume's uid and gid
|
||||
stat = self.mount_a.stat(subvol_path)
|
||||
self.assertEqual(stat['st_uid'], expected_uid)
|
||||
self.assertEqual(stat['st_gid'], expected_gid)
|
||||
|
||||
# remove subvolume
|
||||
self._fs_cmd("subvolume", "rm", self.volname, subvolume)
|
||||
|
||||
### subvolume group operations
|
||||
|
||||
def test_subvolume_create_and_rm_in_group(self):
|
||||
@ -309,6 +326,23 @@ class TestVolumes(CephFSTestCase):
|
||||
# force remove subvolume
|
||||
self._fs_cmd("subvolumegroup", "rm", self.volname, group, "--force")
|
||||
|
||||
def test_default_uid_gid_subvolume_group(self):
|
||||
group = self._generate_random_group_name()
|
||||
expected_uid = 0
|
||||
expected_gid = 0
|
||||
|
||||
# create group
|
||||
self._fs_cmd("subvolumegroup", "create", self.volname, group)
|
||||
group_path = self._get_subvolume_group_path(self.volname, group)
|
||||
|
||||
# check group's uid and gid
|
||||
stat = self.mount_a.stat(group_path)
|
||||
self.assertEqual(stat['st_uid'], expected_uid)
|
||||
self.assertEqual(stat['st_gid'], expected_gid)
|
||||
|
||||
# remove group
|
||||
self._fs_cmd("subvolumegroup", "rm", self.volname, group)
|
||||
|
||||
### snapshot operations
|
||||
|
||||
def test_subvolume_snapshot_create_and_rm(self):
|
||||
|
@ -69,6 +69,9 @@ class ConnectionPool(object):
|
||||
assert self.ops_in_progress == 0
|
||||
log.debug("Connecting to cephfs '{0}'".format(self.fs_name))
|
||||
self.fs = cephfs.LibCephFS(rados_inst=self.mgr.rados)
|
||||
log.debug("Setting user ID and group ID of CephFS mount as root...")
|
||||
self.fs.conf_set("client_mount_uid", "0")
|
||||
self.fs.conf_set("client_mount_gid", "0")
|
||||
log.debug("CephFS initializing...")
|
||||
self.fs.init()
|
||||
log.debug("CephFS mounting...")
|
||||
|
Loading…
Reference in New Issue
Block a user