]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard/qa: Improve tasks.mgr.test_dashboard.TestDashboard.test_standby 27237/head
authorVolker Theile <vtheile@suse.com>
Wed, 13 Mar 2019 10:39:49 +0000 (11:39 +0100)
committerTatjana Dehler <tdehler@suse.com>
Thu, 28 Mar 2019 08:57:03 +0000 (09:57 +0100)
The changes of this PR were done while trying to fix the failing test. The problem has been solved by another PR, but the changes are worth to be integrated because they help debugging and an additional test has been added (check if previously active manager is listed as standby).

Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit c29e587007e461738d4f95938dc2eb44f2459964)

qa/tasks/mgr/mgr_test_case.py
qa/tasks/mgr/test_dashboard.py
src/pybind/mgr/dashboard/module.py

index 4f319ed1eb5676f9bc90c56a1c4383b3f8987e0d..7684a95565af7cfe480e1cbca4b90f61904f1d82 100644 (file)
@@ -199,6 +199,6 @@ class MgrTestCase(CephTestCase):
             done = mgr_map['available']
             if done:
                 log.info("Available after assign ports (new active {0}/{1})".format(
-                    mgr_map['active_name'] , mgr_map['active_gid']))
+                    mgr_map['active_name'], mgr_map['active_gid']))
             return done
         cls.wait_until_true(is_available, timeout=30)
index 6a98e0ec4b2a00326e559346db02a80f043224e0..44d632b1f3822d1213aa02d3e2fb3091fe208a5b 100644 (file)
@@ -21,15 +21,22 @@ class TestDashboard(MgrTestCase):
                                                      "create-self-signed-cert")
 
     def test_standby(self):
-        original_active = self.mgr_cluster.get_active_id()
-
+        original_active_id = self.mgr_cluster.get_active_id()
         original_uri = self._get_uri("dashboard")
-        log.info("Originally running at {0}".format(original_uri))
+        log.info("Originally running manager '{}' at {}".format(
+            original_active_id, original_uri))
 
-        self.mgr_cluster.mgr_fail(original_active)
+        # Force a failover and wait until the previously active manager
+        # is listed as standby.
+        self.mgr_cluster.mgr_fail(original_active_id)
+        self.wait_until_true(
+            lambda: original_active_id in self.mgr_cluster.get_standby_ids(),
+            timeout=30)
 
+        failed_active_id = self.mgr_cluster.get_active_id()
         failed_over_uri = self._get_uri("dashboard")
-        log.info("After failover running at {0}".format(failed_over_uri))
+        log.info("After failover running manager '{}' at {}".format(
+            failed_active_id, failed_over_uri))
 
         self.assertNotEqual(original_uri, failed_over_uri)
 
index 6be074d2a49aa68d8c130d6fdf3a0570a9dd8eb1..b236a1ac024adb073ca3b59c0c641e4d9c33be82 100644 (file)
@@ -449,7 +449,7 @@ class StandbyModule(MgrStandbyModule, CherryPyConfig):
                     </head>
                     <body>
                         No active ceph-mgr instance is currently running
-                        the dashboard.  A failover may be in progress.
+                        the dashboard. A failover may be in progress.
                         Retrying in {delay} seconds...
                     </body>
                 </html>