From ac68a0f8d5c53cf53687d893f89dfe575c7795ed Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 9 Mar 2021 13:54:34 -0800 Subject: [PATCH] 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) --- qa/suites/fs/cephadm/multivolume/0-start.yaml | 4 ++-- qa/tasks/fs.py | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) 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. -- 2.47.3