]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/tasks/mgr/dashboard/test_motd.py
1 # -*- coding: utf-8 -*-
2 # pylint: disable=too-many-public-methods
4 from __future__
import absolute_import
8 from .helper
import DashboardTestCase
11 class MotdTest(DashboardTestCase
):
13 def tearDownClass(cls
):
14 cls
._ceph
_cmd
(['dashboard', 'motd', 'clear'])
15 super(MotdTest
, cls
).tearDownClass()
18 super(MotdTest
, self
).setUp()
19 self
._ceph
_cmd
(['dashboard', 'motd', 'clear'])
22 data
= self
._get
('/ui-api/motd')
23 self
.assertStatus(200)
24 self
.assertIsNone(data
)
27 self
._ceph
_cmd
(['dashboard', 'motd', 'set', 'info', '0', 'foo bar baz'])
28 data
= self
._get
('/ui-api/motd')
29 self
.assertStatus(200)
30 self
.assertIsInstance(data
, dict)
32 def test_expired(self
):
33 self
._ceph
_cmd
(['dashboard', 'motd', 'set', 'info', '2s', 'foo bar baz'])
35 data
= self
._get
('/ui-api/motd')
36 self
.assertStatus(200)
37 self
.assertIsNone(data
)