diff options
author | Mykola Golub <mgolub@suse.com> | 2018-02-24 10:43:21 +0100 |
---|---|---|
committer | Jason Dillaman <dillaman@redhat.com> | 2018-08-15 00:29:45 +0200 |
commit | 2bcc61a854aaa03aa8fd4d013e69c7485f20b5af (patch) | |
tree | fddb41e191ab88d10961943229a85cbc608c2026 /src/test/pybind | |
parent | librbd: API for image migration (diff) | |
download | ceph-2bcc61a854aaa03aa8fd4d013e69c7485f20b5af.tar.xz ceph-2bcc61a854aaa03aa8fd4d013e69c7485f20b5af.zip |
pybind/rbd: API for image migration
Signed-off-by: Mykola Golub <mgolub@suse.com>
Diffstat (limited to 'src/test/pybind')
-rw-r--r-- | src/test/pybind/test_rbd.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/test/pybind/test_rbd.py b/src/test/pybind/test_rbd.py index 9fa4eb3ed2a..38cd58bfd3a 100644 --- a/src/test/pybind/test_rbd.py +++ b/src/test/pybind/test_rbd.py @@ -22,7 +22,8 @@ from rbd import (RBD, Group, Image, ImageNotFound, InvalidArgument, ImageExists, RBD_MIRROR_MODE_POOL, RBD_MIRROR_IMAGE_ENABLED, RBD_MIRROR_IMAGE_DISABLED, MIRROR_IMAGE_STATUS_STATE_UNKNOWN, RBD_LOCK_MODE_EXCLUSIVE, RBD_OPERATION_FEATURE_GROUP, - RBD_SNAP_NAMESPACE_TYPE_TRASH) + RBD_SNAP_NAMESPACE_TYPE_TRASH, + RBD_IMAGE_MIGRATION_STATE_PREPARED) rados = None ioctx = None @@ -1910,3 +1911,28 @@ class TestGroups(object): def test_rename(): rbd = RBD() image_name2 = get_temp_image_name() + +class TestMigration(object): + + def test_migration(self): + create_image() + RBD().migration_prepare(ioctx, image_name, ioctx, image_name, features=63, + order=23, stripe_unit=1<<23, stripe_count=1, + data_pool=None) + + status = RBD().migration_status(ioctx, image_name) + eq(image_name, status['source_image_name']) + eq(image_name, status['dest_image_name']) + eq(RBD_IMAGE_MIGRATION_STATE_PREPARED, status['state']) + + RBD().migration_execute(ioctx, image_name) + RBD().migration_commit(ioctx, image_name) + remove_image() + + def test_migrate_abort(self): + create_image() + RBD().migration_prepare(ioctx, image_name, ioctx, image_name, features=63, + order=23, stripe_unit=1<<23, stripe_count=1, + data_pool=None) + RBD().migration_abort(ioctx, image_name) + remove_image() |