Skip to content

Commit

Permalink
Merge pull request ceph#586 from ceph/wip-mdscap
Browse files Browse the repository at this point in the history
tasks/cephfs: mds allow

Reviewed-by: John Spray <[email protected]>
  • Loading branch information
jcsp committed Sep 29, 2015
2 parents 79cbfc8 + a4f9bdb commit a5a361e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
8 changes: 5 additions & 3 deletions tasks/cephfs/cephfs_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ def setUp(self):

# In case some test messed with auth caps, reset them
for mount in self.mounts:
self.fs.mon_manager.raw_cluster_cmd_result('auth', 'caps', "client.{0}".format(mount.client_id),
'mon', 'allow r', 'osd',
'allow rw pool={0}'.format(self.fs.get_data_pool_name()))
self.fs.mon_manager.raw_cluster_cmd_result(
'auth', 'caps', "client.{0}".format(mount.client_id),
'mds', 'allow',
'mon', 'allow r',
'osd', 'allow rw pool={0}'.format(self.fs.get_data_pool_name()))

self.fs.mds_restart()
self.fs.wait_for_daemons()
Expand Down
17 changes: 10 additions & 7 deletions tasks/cephfs/test_pool_perm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ def test_pool_perm(self):
client_name = "client.{0}".format(self.mount_a.client_id)

# set data pool read only
self.fs.mon_manager.raw_cluster_cmd_result('auth', 'caps', client_name, 'mon', 'allow r', 'osd',
'allow r pool={0}'.format(self.fs.get_data_pool_name()))
self.fs.mon_manager.raw_cluster_cmd_result(
'auth', 'caps', client_name, 'mds', 'allow', 'mon', 'allow r', 'osd',
'allow r pool={0}'.format(self.fs.get_data_pool_name()))

self.mount_a.umount_wait()
self.mount_a.mount()
Expand All @@ -40,8 +41,9 @@ def test_pool_perm(self):
self.mount_a.run_python(remote_script.format(path=file_path, check_read=str(False)))

# set data pool write only
self.fs.mon_manager.raw_cluster_cmd_result('auth', 'caps', client_name, 'mon', 'allow r', 'osd',
'allow w pool={0}'.format(self.fs.get_data_pool_name()))
self.fs.mon_manager.raw_cluster_cmd_result(
'auth', 'caps', client_name, 'mds', 'allow', 'mon', 'allow r', 'osd',
'allow w pool={0}'.format(self.fs.get_data_pool_name()))

self.mount_a.umount_wait()
self.mount_a.mount()
Expand All @@ -51,8 +53,9 @@ def test_pool_perm(self):
self.mount_a.run_python(remote_script.format(path=file_path, check_read=str(True)))

def tearDown(self):
self.fs.mon_manager.raw_cluster_cmd_result('auth', 'caps', "client.{0}".format(self.mount_a.client_id),
'mon', 'allow r', 'osd',
'allow rw pool={0}'.format(self.fs.get_data_pool_name()))
self.fs.mon_manager.raw_cluster_cmd_result(
'auth', 'caps', "client.{0}".format(self.mount_a.client_id),
'mds', 'allow', 'mon', 'allow r', 'osd',
'allow rw pool={0}'.format(self.fs.get_data_pool_name()))

super(TestPoolPerm, self).tearDown()

0 comments on commit a5a361e

Please sign in to comment.