mirror of
https://github.com/ceph/ceph
synced 2025-01-09 04:30:26 +00:00
1b67691492
Fixes: https://tracker.ceph.com/issues/47757 Signed-off-by: Tatjana Dehler <tdehler@suse.com>
35 lines
922 B
Python
35 lines
922 B
Python
# -*- coding: utf-8 -*-
|
|
from __future__ import absolute_import
|
|
|
|
from .helper import DashboardTestCase, JList, JObj, addrvec_schema
|
|
|
|
|
|
class LogsTest(DashboardTestCase):
|
|
CEPHFS = True
|
|
|
|
def test_logs(self):
|
|
data = self._get("/api/logs/all")
|
|
self.assertStatus(200)
|
|
log_entry_schema = JList(JObj({
|
|
'addrs': JObj({
|
|
'addrvec': addrvec_schema
|
|
}),
|
|
'channel': str,
|
|
'message': str,
|
|
'name': str,
|
|
'priority': str,
|
|
'rank': str,
|
|
'seq': int,
|
|
'stamp': str
|
|
}))
|
|
schema = JObj({
|
|
'audit_log': log_entry_schema,
|
|
'clog': log_entry_schema
|
|
})
|
|
self.assertSchema(data, schema)
|
|
|
|
@DashboardTestCase.RunAs('test', 'test', ['pool-manager'])
|
|
def test_log_perms(self):
|
|
self._get("/api/logs/all")
|
|
self.assertStatus(403)
|