From: Kefu Chai Date: Thu, 3 Jan 2019 03:00:31 +0000 (+0800) Subject: qa/mgr: extract module_info_schema and reused it X-Git-Tag: v14.1.0~504^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b0a83097ebc0e177750d9378720f84b3932021d1;p=ceph-ci.git qa/mgr: extract module_info_schema and reused it both standby mgr and active mgr have this sub-schema. so extract it out and reuse it. Signed-off-by: Kefu Chai --- diff --git a/qa/tasks/mgr/dashboard/test_health.py b/qa/tasks/mgr/dashboard/test_health.py index 12d9bdba6f0..f42781e187f 100644 --- a/qa/tasks/mgr/dashboard/test_health.py +++ b/qa/tasks/mgr/dashboard/test_health.py @@ -78,6 +78,11 @@ class HealthTest(DashboardTestCase): def test_full_health(self): data = self._get('/api/health/full') self.assertStatus(200) + module_info_schema = JObj({ + 'can_run': bool, + 'error_string': str, + 'name': str + }) schema = JObj({ 'client_perf': JObj({ 'read_bytes_sec': int, @@ -169,11 +174,7 @@ class HealthTest(DashboardTestCase): allow_unknown=True, unknown_schema=JList(str) ), 'available': bool, - 'available_modules': JList(JObj({ - 'can_run': bool, - 'error_string': str, - 'name': str - })), + 'available_modules': JList(module_info_schema), 'epoch': int, 'modules': JList(str), 'services': JObj( @@ -181,11 +182,7 @@ class HealthTest(DashboardTestCase): allow_unknown=True, unknown_schema=str ), 'standbys': JList(JObj({ - 'available_modules': JList(JObj({ - 'can_run': bool, - 'error_string': str, - 'name': str - })), + 'available_modules': JList(module_info_schema), 'gid': int, 'name': str }))