]> git.proxmox.com Git - ceph.git/blobdiff - ceph/qa/tasks/mgr/dashboard/test_rbd.py
import 15.2.5
[ceph.git] / ceph / qa / tasks / mgr / dashboard / test_rbd.py
index 1c89651b425e2fc07b29a2462c77e9f0afac8746..48119383bf3c04ebbf4863f8c705f3e2a91898a6 100644 (file)
@@ -5,7 +5,7 @@ from __future__ import absolute_import
 
 import time
 
-from tasks.mgr.dashboard.helper import DashboardTestCase, JObj, JLeaf, JList
+from .helper import DashboardTestCase, JObj, JLeaf, JList
 
 
 class RbdTest(DashboardTestCase):
@@ -173,14 +173,13 @@ class RbdTest(DashboardTestCase):
         cls._ceph_cmd(['osd', 'pool', 'delete', 'rbd_data', 'rbd_data',
                        '--yes-i-really-really-mean-it'])
 
-    @classmethod
-    def create_image_in_trash(cls, pool, name, delay=0):
-        cls.create_image(pool, None, name, 10240)
-        img = cls._get('/api/block/image/{}%2F{}'.format(pool, name))
+    def create_image_in_trash(self, pool, name, delay=0):
+        self.create_image(pool, None, name, 10240)
+        img = self._get('/api/block/image/{}%2F{}'.format(pool, name))
 
-        cls._task_post("/api/block/image/{}%2F{}/move_trash".format(pool, name),
+        self._task_post("/api/block/image/{}%2F{}/move_trash".format(pool, name),
                        {'delay': delay})
-
+        self.assertStatus([200, 201])
         return img['id']
 
     @classmethod
@@ -236,6 +235,8 @@ class RbdTest(DashboardTestCase):
             'block_name_prefix': JLeaf(str),
             'name': JLeaf(str),
             'id': JLeaf(str),
+            'unique_id': JLeaf(str),
+            'image_format': JLeaf(int),
             'pool_name': JLeaf(str),
             'namespace': JLeaf(str, none=True),
             'features': JLeaf(int),
@@ -774,7 +775,6 @@ class RbdTest(DashboardTestCase):
 
     def test_move_image_to_trash(self):
         id = self.create_image_in_trash('rbd', 'test_rbd')
-        self.assertStatus(200)
 
         self.get_image('rbd', None, 'test_rbd')
         self.assertStatus(404)