]> git.proxmox.com Git - ceph.git/blame - ceph/qa/tasks/mgr/dashboard/test_logs.py
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / qa / tasks / mgr / dashboard / test_logs.py
CommitLineData
11fdf7f2
TL
1# -*- coding: utf-8 -*-
2from __future__ import absolute_import
3
f67539c2 4from .helper import DashboardTestCase, JList, JObj, addrvec_schema
11fdf7f2
TL
5
6
7class LogsTest(DashboardTestCase):
8 CEPHFS = True
9
10 def test_logs(self):
11 data = self._get("/api/logs/all")
12 self.assertStatus(200)
13 log_entry_schema = JList(JObj({
14 'addrs': JObj({
f67539c2 15 'addrvec': addrvec_schema
11fdf7f2
TL
16 }),
17 'channel': str,
18 'message': str,
19 'name': str,
20 'priority': str,
21 'rank': str,
22 'seq': int,
23 'stamp': str
24 }))
25 schema = JObj({
26 'audit_log': log_entry_schema,
27 'clog': log_entry_schema
28 })
29 self.assertSchema(data, schema)
30
31 @DashboardTestCase.RunAs('test', 'test', ['pool-manager'])
32 def test_log_perms(self):
33 self._get("/api/logs/all")
34 self.assertStatus(403)