mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
qa: test mgr cephfs mount blacklist
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
parent
df507cde8d
commit
98e3b7efe8
@ -228,6 +228,15 @@ class CephFSTestCase(CephTestCase):
|
|||||||
def _session_by_id(self, session_ls):
|
def _session_by_id(self, session_ls):
|
||||||
return dict([(s['id'], s) for s in session_ls])
|
return dict([(s['id'], s) for s in session_ls])
|
||||||
|
|
||||||
|
def wait_until_evicted(self, client_id, timeout=30):
|
||||||
|
def helper():
|
||||||
|
ls = self._session_list()
|
||||||
|
for s in ls:
|
||||||
|
if s['id'] == client_id:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
self.wait_until_true(lambda: helper(), timeout)
|
||||||
|
|
||||||
def wait_for_daemon_start(self, daemon_ids=None):
|
def wait_for_daemon_start(self, daemon_ids=None):
|
||||||
"""
|
"""
|
||||||
Wait until all the daemons appear in the FSMap, either assigned
|
Wait until all the daemons appear in the FSMap, either assigned
|
||||||
|
@ -1073,3 +1073,20 @@ class TestVolumes(CephFSTestCase):
|
|||||||
|
|
||||||
# verify trash dir is clean
|
# verify trash dir is clean
|
||||||
self._wait_for_trash_empty()
|
self._wait_for_trash_empty()
|
||||||
|
|
||||||
|
def test_mgr_eviction(self):
|
||||||
|
# unmount any cephfs mounts
|
||||||
|
self.mount_a.umount_wait()
|
||||||
|
sessions = self._session_list()
|
||||||
|
self.assertLessEqual(len(sessions), 1) # maybe mgr is already mounted
|
||||||
|
|
||||||
|
# Get the mgr to definitely mount cephfs
|
||||||
|
subvolume = self._generate_random_subvolume_name()
|
||||||
|
self._fs_cmd("subvolume", "create", self.volname, subvolume)
|
||||||
|
sessions = self._session_list()
|
||||||
|
self.assertEqual(len(sessions), 1)
|
||||||
|
|
||||||
|
# Now fail the mgr, check the session was evicted
|
||||||
|
mgr = self.mgr_cluster.get_active_id()
|
||||||
|
self.mgr_cluster.mgr_fail(mgr)
|
||||||
|
self.wait_until_evicted(sessions[0]['id'])
|
||||||
|
Loading…
Reference in New Issue
Block a user