]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs/test_nfs: wait for fs to come up before exporting 43709/head
authorSage Weil <sage@newdream.net>
Thu, 28 Oct 2021 15:23:21 +0000 (11:23 -0400)
committerSage Weil <sage@newdream.net>
Thu, 28 Oct 2021 17:28:35 +0000 (13:28 -0400)
Signed-off-by: Sage Weil <sage@newdream.net>
qa/tasks/cephfs/test_nfs.py

index 0b690cd662a8962e440107a4742785542e9afd3e..0d5099504c6b8aebe04efa844e7ecb0041c5d662 100644 (file)
@@ -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)