ceph/qa/tasks/mgr/dashboard/test_orchestrator.py
Kiefer Chang 812c105a43
mgr/dashboard: refactor /api/orchestrator/* endpoints
- API changes:
  - Move `/api/orchestrator/identify_device` to
    `/api/host/<hostname>/identify_device`.
  - Move `/api/orchestartor/inventory` to `/ui-api/host/inventory`. This
    UI API provides a shortcut to get all inventories.
  - Add `/api/host/<hostname>/inventory` for getting a host's inventory.
  - Add inventory schema to improve OpenAPI doc.
- Backend unittests:
  - Refactor: Remove duplicated orchestrator patch calls.
  - Add unittest for identify device.

Fixes: https://tracker.ceph.com/issues/43165
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
2020-11-26 15:44:11 +08:00

28 lines
699 B
Python

# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .helper import DashboardTestCase
class OrchestratorControllerTest(DashboardTestCase):
AUTH_ROLES = ['cluster-manager']
URL_STATUS = '/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'])