]> git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/mgr/dashboard/test_logs.py
import 15.2.4
[ceph.git] / ceph / qa / tasks / mgr / dashboard / test_logs.py
1 # -*- coding: utf-8 -*-
2 from __future__ import absolute_import
3
4 from tasks.mgr.dashboard.helper import DashboardTestCase, JList, JObj
5
6
7 class 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({
15 'addrvec': JList(JObj({
16 'addr': str,
17 'nonce': int,
18 'type': str
19 }))
20 }),
21 'channel': str,
22 'message': str,
23 'name': str,
24 'priority': str,
25 'rank': str,
26 'seq': int,
27 'stamp': str
28 }))
29 schema = JObj({
30 'audit_log': log_entry_schema,
31 'clog': log_entry_schema
32 })
33 self.assertSchema(data, schema)
34
35 @DashboardTestCase.RunAs('test', 'test', ['pool-manager'])
36 def test_log_perms(self):
37 self._get("/api/logs/all")
38 self.assertStatus(403)