From a2033e0845da75e7ae4f2c694f4e34f07725d3d9 Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Thu, 15 Mar 2018 12:44:52 +0000 Subject: [PATCH] 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 --- qa/tasks/mgr/dashboard_v2/test_perf_counters.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- 2.47.3