]> git.proxmox.com Git - ceph.git/blobdiff - ceph/qa/tasks/mgr/dashboard/test_osd.py
import 15.2.5
[ceph.git] / ceph / qa / tasks / mgr / dashboard / test_osd.py
index 4f2028d2297ef473744541fbfb737a351d40ef30..0bd3f93f32495b37b1688fe887b47455c11ef021 100644 (file)
@@ -4,7 +4,7 @@ from __future__ import absolute_import
 
 import json
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj, JAny, JList, JLeaf, JTuple
+from .helper import DashboardTestCase, JObj, JAny, JList, JLeaf, JTuple
 
 
 class OsdTest(DashboardTestCase):
@@ -61,6 +61,19 @@ class OsdTest(DashboardTestCase):
         self._post('/api/osd/0/scrub?deep=True')
         self.assertStatus(200)
 
+    def test_safe_to_delete(self):
+        data = self._get('/api/osd/safe_to_delete?svc_ids=0')
+        self.assertStatus(200)
+        self.assertSchema(data, JObj({
+             'is_safe_to_delete': JAny(none=True),
+             'message': str
+             }))
+        self.assertTrue(data['is_safe_to_delete'])
+
+    def test_osd_smart(self):
+        self._get('/api/osd/0/smart')
+        self.assertStatus(200)
+
     def test_mark_out_and_in(self):
         self._post('/api/osd/0/mark_out')
         self.assertStatus(200)
@@ -98,6 +111,18 @@ class OsdTest(DashboardTestCase):
             'tracking_id': 'bare-5'
         })
         self.assertStatus(201)
+
+        # invalid method
+        self._task_post('/api/osd', {
+            'method': 'xyz',
+            'data': {
+                'uuid': 'f860ca2e-757d-48ce-b74a-87052cad563f',
+                'svc_id': 5
+            },
+            'tracking_id': 'bare-5'
+        })
+        self.assertStatus(400)
+
         # Lost
         self._post('/api/osd/5/mark_lost')
         self.assertStatus(200)