Skip to content

Commit

Permalink
Merge pull request #933 from ceph/wip-fs-lockouts
Browse files Browse the repository at this point in the history
cephfs: update tests to enable multimds when needed
  • Loading branch information
gregsfortytwo committed Apr 12, 2016
2 parents 89b1578 + a739533 commit 7cd48db
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tasks/ceph.py
Expand Up @@ -287,6 +287,13 @@ def cephfs_setup(ctx, config):
is_active_mds = lambda role: role.startswith('mds.') and not role.endswith('-s') and role.find('-s-') == -1
all_roles = [item for remote_roles in mdss.remotes.values() for item in remote_roles]
num_active = len([r for r in all_roles if is_active_mds(r)])
mon_remote.run(args=[
'sudo',
'adjust-ulimits',
'ceph-coverage',
coverage_dir,
'ceph', 'mds', 'set', 'allow_multimds', 'true',
'--yes-i-really-mean-it'])
mon_remote.run(args=[
'sudo',
'adjust-ulimits',
Expand Down
3 changes: 3 additions & 0 deletions tasks/cephfs/test_data_scan.py
Expand Up @@ -426,6 +426,9 @@ def test_fragmented_injection(self):
That when injecting a dentry into a fragmented directory, we put it in the right fragment.
"""

self.fs.mon_manager.raw_cluster_cmd("mds", "set", "allow_dirfrags", "true",
"--yes-i-really-mean-it")

file_count = 100
file_names = ["%s" % n for n in range(0, file_count)]

Expand Down
18 changes: 17 additions & 1 deletion tasks/cephfs/test_failover.py
Expand Up @@ -160,7 +160,8 @@ class TestMultiFilesystems(CephFSTestCase):
def setUp(self):
super(TestMultiFilesystems, self).setUp()
self.fs.mon_manager.raw_cluster_cmd("fs", "flag", "set",
"enable_multiple", "true")
"enable_multiple", "true",
"--yes-i-really-mean-it")

def _setup_two(self):
fs_a = self.mds_cluster.get_filesystem("alpha")
Expand Down Expand Up @@ -261,6 +262,13 @@ def test_standby(self):
def test_grow_shrink(self):
# Usual setup...
fs_a, fs_b = self._setup_two()
fs_a.mon_manager.raw_cluster_cmd("fs", "set", fs_a.name,
"allow_multimds", "true",
"--yes-i-really-mean-it")

fs_b.mon_manager.raw_cluster_cmd("fs", "set", fs_b.name,
"allow_multimds", "true",
"--yes-i-really-mean-it")

# Increase max_mds on fs_b, see a standby take up the role
fs_b.mon_manager.raw_cluster_cmd('fs', 'set', fs_b.name, 'max_mds', "2")
Expand Down Expand Up @@ -431,8 +439,16 @@ def set_standby_for(leader_fs, follower_id):
# Create two filesystems which should have two ranks each
fs_a = self.mds_cluster.get_filesystem("alpha")
fs_a.create()
fs_a.mon_manager.raw_cluster_cmd("fs", "set", fs_a.name,
"allow_multimds", "true",
"--yes-i-really-mean-it")

fs_b = self.mds_cluster.get_filesystem("bravo")
fs_b.create()
fs_b.mon_manager.raw_cluster_cmd("fs", "set", fs_b.name,
"allow_multimds", "true",
"--yes-i-really-mean-it")

fs_a.mon_manager.raw_cluster_cmd('fs', 'set', fs_a.name,
'max_mds', "2")
fs_b.mon_manager.raw_cluster_cmd('fs', 'set', fs_b.name,
Expand Down
2 changes: 2 additions & 0 deletions tasks/cephfs/test_journal_repair.py
Expand Up @@ -160,6 +160,8 @@ def test_reset(self):
"""

# Set max_mds to 2
self.fs.mon_manager.raw_cluster_cmd_result('mds', 'set', "allow_multimds",
"true", "--yes-i-really-mean-it")
self.fs.mon_manager.raw_cluster_cmd_result('mds', 'set', "max_mds", "2")

# See that we have two active MDSs
Expand Down
2 changes: 2 additions & 0 deletions tasks/cephfs/test_sessionmap.py
Expand Up @@ -96,6 +96,8 @@ def test_version_splitting(self):
self.fs.wait_for_daemons()

# I would like two MDSs, so that I can do an export dir later
self.fs.mon_manager.raw_cluster_cmd_result('mds', 'set', "allow_multimds",
"true", "--yes-i-really-mean-it")
self.fs.mon_manager.raw_cluster_cmd_result('mds', 'set', "max_mds", "2")
self.fs.wait_for_daemons()

Expand Down
2 changes: 2 additions & 0 deletions tasks/cephfs/test_strays.py
Expand Up @@ -414,6 +414,8 @@ def test_migration_on_shutdown(self):
"""

# Set up two MDSs
self.fs.mon_manager.raw_cluster_cmd_result('mds', 'set', "allow_multimds",
"true", "--yes-i-really-mean-it")
self.fs.mon_manager.raw_cluster_cmd_result('mds', 'set', "max_mds", "2")

# See that we have two active MDSs
Expand Down

0 comments on commit 7cd48db

Please sign in to comment.