Merge pull request #25761 from tchaikov/wip-qa-health-schema

mgr/dashboard: updated API test to reflect changes in ModuleInfo

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Kefu Chai 2019-01-03 23:15:45 +08:00 committed by GitHub
commit 407750d16e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,6 +78,28 @@ class HealthTest(DashboardTestCase):
def test_full_health(self): def test_full_health(self):
data = self._get('/api/health/full') data = self._get('/api/health/full')
self.assertStatus(200) self.assertStatus(200)
module_info_schema = JObj({
'can_run': bool,
'error_string': str,
'name': str,
'module_options': JObj(
{},
allow_unknown=True,
unknown_schema=JObj({
'name': str,
'type': str,
'level': str,
'flags': int,
'default_value': str,
'min': str,
'max': str,
'enum_allowed': JList(str),
'see_also': JList(str),
'desc': str,
'long_desc': str,
'tags': JList(str),
})),
})
schema = JObj({ schema = JObj({
'client_perf': JObj({ 'client_perf': JObj({
'read_bytes_sec': int, 'read_bytes_sec': int,
@ -169,11 +191,7 @@ class HealthTest(DashboardTestCase):
allow_unknown=True, unknown_schema=JList(str) allow_unknown=True, unknown_schema=JList(str)
), ),
'available': bool, 'available': bool,
'available_modules': JList(JObj({ 'available_modules': JList(module_info_schema),
'can_run': bool,
'error_string': str,
'name': str
})),
'epoch': int, 'epoch': int,
'modules': JList(str), 'modules': JList(str),
'services': JObj( 'services': JObj(
@ -181,11 +199,7 @@ class HealthTest(DashboardTestCase):
allow_unknown=True, unknown_schema=str allow_unknown=True, unknown_schema=str
), ),
'standbys': JList(JObj({ 'standbys': JList(JObj({
'available_modules': JList(JObj({ 'available_modules': JList(module_info_schema),
'can_run': bool,
'error_string': str,
'name': str
})),
'gid': int, 'gid': int,
'name': str 'name': str
})) }))