From: Patrick Donnelly Date: Tue, 9 Mar 2021 21:54:34 +0000 (-0800) Subject: qa: wait for daemons to come up via cephadm X-Git-Tag: v16.2.2~8^2~5^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F40528%2Fhead;p=ceph.git qa: wait for daemons to come up via cephadm Rather than waiting for a set amount of time. Fixes: https://tracker.ceph.com/issues/49684 Signed-off-by: Patrick Donnelly (cherry picked from commit d06689e16e3264b21b33326db5e328faef0da799) --- diff --git a/qa/suites/fs/cephadm/multivolume/0-start.yaml b/qa/suites/fs/cephadm/multivolume/0-start.yaml index 4e832878ad20..13dc863d2936 100644 --- a/qa/suites/fs/cephadm/multivolume/0-start.yaml +++ b/qa/suites/fs/cephadm/multivolume/0-start.yaml @@ -35,5 +35,5 @@ tasks: host.a: - ceph fs volume create foo - ceph fs volume create bar -- sleep: - interval: 60 +- fs.ready: + timeout: 300 diff --git a/qa/tasks/fs.py b/qa/tasks/fs.py index 4f7a3e2060b6..1a6cfcfb3826 100644 --- a/qa/tasks/fs.py +++ b/qa/tasks/fs.py @@ -5,10 +5,29 @@ CephFS sub-tasks. import logging import re -from tasks.cephfs.filesystem import Filesystem +from tasks.cephfs.filesystem import Filesystem, MDSCluster log = logging.getLogger(__name__) +def ready(ctx, config): + """ + That the file system is ready for clients. + """ + + if config is None: + config = {} + assert isinstance(config, dict), \ + 'task only accepts a dict for configuration' + + timeout = config.get('timeout', 300) + + mdsc = MDSCluster(ctx) + status = mdsc.status() + + for filesystem in status.get_filesystems(): + fs = Filesystem(ctx, fscid=filesystem['id']) + fs.wait_for_daemons(timeout=timeout, status=status) + def clients_evicted(ctx, config): """ Check clients are evicted, unmount (cleanup) if so.