From: Sage Weil Date: Thu, 28 Oct 2021 15:23:21 +0000 (-0400) Subject: qa/tasks/cephfs/test_nfs: wait for fs to come up before exporting X-Git-Tag: v17.1.0~568^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F43709%2Fhead;p=ceph.git qa/tasks/cephfs/test_nfs: wait for fs to come up before exporting Signed-off-by: Sage Weil --- diff --git a/qa/tasks/cephfs/test_nfs.py b/qa/tasks/cephfs/test_nfs.py index 0b690cd662a8..0d5099504c6b 100644 --- a/qa/tasks/cephfs/test_nfs.py +++ b/qa/tasks/cephfs/test_nfs.py @@ -6,6 +6,7 @@ import logging from io import BytesIO from tasks.mgr.mgr_test_case import MgrTestCase +from teuthology import contextutil from teuthology.exceptions import CommandFailedError log = logging.getLogger(__name__) @@ -153,6 +154,15 @@ class TestNFS(MgrTestCase): ''' if create_fs: self._cmd('fs', 'volume', 'create', self.fs_name) + with contextutil.safe_while(sleep=5, tries=30) as proceed: + while proceed(): + output = self._cmd( + 'orch', 'ls', '-f', 'json', + '--service-name', f'mds.{self.fs_name}' + ) + j = json.loads(output) + if j[0]['status']['running']: + break export_cmd = ['nfs', 'export', 'create', 'cephfs', self.fs_name, self.cluster_id] if isinstance(extra_cmd, list): export_cmd.extend(extra_cmd)