From: Jason Dillaman Date: Tue, 25 Aug 2015 17:34:12 +0000 (-0400) Subject: tests: added snap protect/unprotect and rename to client update test X-Git-Tag: v10.0.2~193^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c1bca63f2c6020b386f664fef6070e970b306963;p=ceph.git tests: added snap protect/unprotect and rename to client update test Signed-off-by: Jason Dillaman --- diff --git a/src/test/librbd/test_notify.py b/src/test/librbd/test_notify.py index 8e0bca8a426..4d3a7713fa5 100755 --- a/src/test/librbd/test_notify.py +++ b/src/test/librbd/test_notify.py @@ -13,6 +13,7 @@ from rbd import (RBD, POOL_NAME='rbd' PARENT_IMG_NAME='test_notify_parent' CLONE_IMG_NAME='test_notify_clone' +CLONE_IMG_RENAME='test_notify_clone2' IMG_SIZE = 16 << 20 IMG_ORDER = 20 @@ -103,6 +104,16 @@ def slave(ioctx): assert(not image.is_exclusive_lock_owner()) assert('snap1' in map(lambda snap: snap['name'], image.list_snaps())) + print("protect_snap") + image.protect_snap('snap1') + assert(not image.is_exclusive_lock_owner()) + assert(image.is_protected_snap()) + + print("unprotect_snap") + image.unprotect_snap('snap1') + assert(not image.is_exclusive_lock_owner()) + assert(not image.is_protected_snap()) + print("remove_snap") image.remove_snap('snap1') assert(not image.is_exclusive_lock_owner()) @@ -113,7 +124,10 @@ def slave(ioctx): image.write(data, 0) assert(image.is_exclusive_lock_owner()) - print("finished") + print("rename") + RBD().rename(ioctx, CLONE_IMG_NAME, CLONE_IMG_RENAME); + + print("finished") def main(): if len(sys.argv) != 2 or sys.argv[1] not in ['master', 'slave']: