From b0a83097ebc0e177750d9378720f84b3932021d1 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 3 Jan 2019 11:00:31 +0800 Subject: [PATCH] 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 --- qa/tasks/mgr/dashboard/test_health.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) 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 })) -- 2.39.5