]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: test health messages from readonly stat
authorJohn Spray <john.spray@redhat.com>
Wed, 6 Apr 2016 16:17:32 +0000 (17:17 +0100)
committerJohn Spray <john.spray@redhat.com>
Wed, 6 Apr 2016 16:17:32 +0000 (17:17 +0100)
Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/cephfs_test_case.py
tasks/cephfs/test_auto_repair.py

index 93aef36c278d6f17c6a94881f957752f8282ce6c..1d8ce13e953a2e880133e545673948b2eec75fe9 100644 (file)
@@ -399,3 +399,13 @@ class CephFSTestCase(unittest.TestCase):
                 raise RuntimeError("Unexpected health messages: {0}".format(summary_strings))
 
         self.wait_until_true(seen_health_warning, timeout)
+
+    def wait_for_health_clear(self, timeout):
+        """
+        Wait until `ceph health` returns no messages
+        """
+        def is_clear():
+            health = self.fs.mon_manager.get_mon_health()
+            return len(health['summary']) == 0
+
+        self.wait_until_true(is_clear, timeout)
index 5ee80602ae5630b44b671fbee63804ee03a291c7..033d8dde902c62df507dd4099c879ec76a5139a0 100644 (file)
@@ -80,6 +80,11 @@ class TestMDSAutoRepair(CephFSTestCase):
         # background writer also should fail
         self.assertTrue(writer.finished)
 
+        # The MDS should report its readonly health state to the mon
+        self.wait_for_health("MDS in read-only mode", timeout=30)
+
         # restart mds to make it writable
         self.fs.mds_fail_restart()
         self.fs.wait_for_daemons()
+
+        self.wait_for_health_clear(timeout=30)