]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard_v2: fix test_perf_counters_mgr_get 20916/head
authorTiago Melo <tmelo@suse.com>
Thu, 15 Mar 2018 12:44:52 +0000 (12:44 +0000)
committerTiago Melo <tmelo@suse.com>
Thu, 15 Mar 2018 12:50:58 +0000 (12:50 +0000)
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 <tmelo@suse.com>
qa/tasks/mgr/dashboard_v2/test_perf_counters.py

index 6f38260303dcdf1c10776cf9a0af4742a3f370b3..4da9236f67dc7aeb019ac14cf22d05bdd5ad4fa5 100644 (file)
@@ -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)