From: Tiago Melo Date: Thu, 15 Mar 2018 12:44:52 +0000 (+0000) Subject: mgr/dashboard_v2: fix test_perf_counters_mgr_get X-Git-Tag: v13.1.0~546^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F20916%2Fhead;p=ceph.git mgr/dashboard_v2: fix test_perf_counters_mgr_get Now that we can obtain perf counters for the mgr, we need to assert that we get more than 0 counters and that they have the desired structure. Fixes: https://tracker.ceph.com/issues/23378 Signed-off-by: Tiago Melo --- diff --git a/qa/tasks/mgr/dashboard_v2/test_perf_counters.py b/qa/tasks/mgr/dashboard_v2/test_perf_counters.py index 6f38260303dc..4da9236f67dc 100644 --- a/qa/tasks/mgr/dashboard_v2/test_perf_counters.py +++ b/qa/tasks/mgr/dashboard_v2/test_perf_counters.py @@ -47,4 +47,10 @@ class PerfCountersControllerTest(DashboardTestCase): self.assertEqual('mgr', data['service']['type']) self.assertEqual(mgr, data['service']['id']) self.assertIsInstance(data['counters'], list) - self.assertEqual(len(data['counters']), 0) + self.assertGreater(len(data['counters']), 0) + counter = data['counters'][0] + self.assertIsInstance(counter, dict) + self.assertIn('description', counter) + self.assertIn('name', counter) + self.assertIn('unit', counter) + self.assertIn('value', counter)