ceph/qa/tasks/mgr/dashboard/test_cluster.py
Avan Thakkar b9f38cadc4 mgr/dashboard: Create Cluster Workflow welcome screen and e2e tests
A module option called CLUSTER_STATUS has two option. INSTALLED
AND POST_INSTALLED. When CLUSTER_STATUS is INSTALLED it will allow to show the
create-cluster-wizard after login the initial time.  After the cluster
creation is succesfull this option is set to POST_INSTALLED
Also has the e2e codes for the Review Section

Fixes: https://tracker.ceph.com/issues/50336
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
Signed-off-by: Nizamudeen A <nia@redhat.com>
2021-10-13 15:52:14 +05:30

24 lines
686 B
Python

from .helper import DashboardTestCase, JLeaf, JObj
class ClusterTest(DashboardTestCase):
def setUp(self):
super().setUp()
self.reset_session()
def test_get_status(self):
data = self._get('/api/cluster', version='0.1')
self.assertStatus(200)
self.assertSchema(data, JObj(sub_elems={
"status": JLeaf(str)
}, allow_unknown=False))
def test_update_status(self):
req = {'status': 'POST_INSTALLED'}
self._put('/api/cluster', req, version='0.1')
self.assertStatus(200)
data = self._get('/api/cluster', version='0.1')
self.assertStatus(200)
self.assertEqual(data, req)