]> git.proxmox.com Git - ceph.git/blobdiff - ceph/qa/tasks/mds_creation_failure.py
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / qa / tasks / mds_creation_failure.py
index d1de15694421dee557cb6b37bafc308c29f5cac0..aa2d6dbf2c062bd10cfee205402e0d6086d616ee 100644 (file)
@@ -29,10 +29,9 @@ def task(ctx, config):
     )
 
     # Stop MDS
-    manager.raw_cluster_cmd('mds', 'set', "max_mds", "0")
-    mds = ctx.daemons.get_daemon('mds', mds_id)
-    mds.stop()
-    manager.raw_cluster_cmd('mds', 'fail', mds_id)
+    self.fs.set_max_mds(0)
+    self.fs.mds_stop(mds_id)
+    self.fs.mds_fail(mds_id)
 
     # Reset the filesystem so that next start will go into CREATING
     manager.raw_cluster_cmd('fs', 'rm', "default", "--yes-i-really-mean-it")
@@ -55,30 +54,14 @@ def task(ctx, config):
     mds_remote.run(args=['rm', '-f', Raw("{archive}/coredump/*.core".format(archive=misc.get_archive_dir(ctx)))])
 
     # It should have left the MDS map state still in CREATING
-    status = manager.get_mds_status(mds_id)
+    status = self.fs.status().get_mds(mds_id)
     assert status['state'] == 'up:creating'
 
     # Start the MDS again without the kill flag set, it should proceed with creation successfully
     mds.restart()
 
     # Wait for state ACTIVE
-    t = 0
-    create_timeout = 120
-    while True:
-        status = manager.get_mds_status(mds_id)
-        if status['state'] == 'up:active':
-            log.info("MDS creation completed successfully")
-            break
-        elif status['state'] == 'up:creating':
-            log.info("MDS still in creating state")
-            if t > create_timeout:
-                log.error("Creating did not complete within %ss" % create_timeout)
-                raise RuntimeError("Creating did not complete within %ss" % create_timeout)
-            t += 1
-            time.sleep(1)
-        else:
-            log.error("Unexpected MDS state: %s" % status['state'])
-            assert(status['state'] in ['up:active', 'up:creating'])
+    self.fs.wait_for_state("up:active", timeout=120, mds_id=mds_id)
 
     # The system should be back up in a happy healthy state, go ahead and run any further tasks
     # inside this context.