mirror of
https://github.com/ceph/ceph
synced 2025-01-01 08:32:24 +00:00
qa/tasks/mgr/dashboard: rbd: image copy test
Signed-off-by: Ricardo Dias <rdias@suse.com>
This commit is contained in:
parent
9dbe25427a
commit
bbe12b0b8a
@ -41,6 +41,14 @@ class RbdTest(DashboardTestCase):
|
||||
.format(parent_pool, parent_image, parent_snap),
|
||||
data)
|
||||
|
||||
@classmethod
|
||||
def copy_image(cls, src_pool, src_image, dest_pool, dest_image, **kwargs):
|
||||
# pylint: disable=too-many-arguments
|
||||
data = {'dest_image_name': dest_image, 'dest_pool_name': dest_pool}
|
||||
data.update(kwargs)
|
||||
return cls._task_post('/api/rbd/{}/{}/copy'
|
||||
.format(src_pool, src_image), data)
|
||||
|
||||
@classmethod
|
||||
def remove_image(cls, pool, image):
|
||||
return cls._task_delete('/api/rbd/{}/{}'.format(pool, image))
|
||||
@ -467,3 +475,33 @@ class RbdTest(DashboardTestCase):
|
||||
self.assertStatus(204)
|
||||
self.remove_image('rbd', 'cimg')
|
||||
self.assertStatus(204)
|
||||
|
||||
def test_copy(self):
|
||||
self.create_image('rbd', 'coimg', 2**30,
|
||||
features=["layering", "exclusive-lock", "fast-diff",
|
||||
"object-map"])
|
||||
self.assertStatus(201)
|
||||
|
||||
self._rbd_cmd(['bench', '--io-type', 'write', '--io-total', '5M',
|
||||
'rbd/coimg'])
|
||||
|
||||
self.copy_image('rbd', 'coimg', 'rbd_iscsi', 'coimg-copy',
|
||||
features=["layering", "fast-diff", "exclusive-lock",
|
||||
"object-map"])
|
||||
self.assertStatus([200, 201])
|
||||
|
||||
img = self._get('/api/rbd/rbd/coimg')
|
||||
self.assertStatus(200)
|
||||
self._validate_image(img, features_name=['layering', 'exclusive-lock',
|
||||
'fast-diff', 'object-map'])
|
||||
|
||||
img_copy = self._get('/api/rbd/rbd_iscsi/coimg-copy')
|
||||
self._validate_image(img_copy, features_name=['exclusive-lock',
|
||||
'fast-diff', 'layering',
|
||||
'object-map'],
|
||||
disk_usage=img['disk_usage'])
|
||||
|
||||
self.remove_image('rbd', 'coimg')
|
||||
self.assertStatus(204)
|
||||
self.remove_image('rbd_iscsi', 'coimg-copy')
|
||||
self.assertStatus(204)
|
||||
|
Loading…
Reference in New Issue
Block a user