ceph/qa/tasks/mgr/dashboard/test_orchestrator.py
Melissa Li 6ac9b3cfe1 mgr/dashboard: add rbd status endpoint
Show "No RBD pools available" error page when accessing block/rbd if there are no rbd pools.
Add a "button_name" and "button_route" property to `ModuleStatusGuardService` config to customize the button on the error page.
Modify `ModuleStatusGuardService` to execute API calls to `/ui-api/<uiApiPath>/status` which uses the `UIRouter`.

Fixes: https://tracker.ceph.com/issues/42109
Signed-off-by: Melissa Li <melissali@redhat.com>
2022-06-07 23:12:39 -04:00

28 lines
702 B
Python

# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .helper import DashboardTestCase
class OrchestratorControllerTest(DashboardTestCase):
AUTH_ROLES = ['cluster-manager']
URL_STATUS = '/ui-api/orchestrator/status'
ORCHESTRATOR = True
@classmethod
def setUpClass(cls):
super(OrchestratorControllerTest, cls).setUpClass()
@classmethod
def tearDownClass(cls):
cmd = ['test_orchestrator', 'load_data', '-i', '-']
cls.mgr_cluster.mon_manager.raw_cluster_cmd_result(*cmd, stdin='{}')
def test_status_get(self):
data = self._get(self.URL_STATUS)
self.assertStatus(200)
self.assertTrue(data['available'])