From c1bca63f2c6020b386f664fef6070e970b306963 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 25 Aug 2015 13:34:12 -0400 Subject: [PATCH] tests: added snap protect/unprotect and rename to client update test Signed-off-by: Jason Dillaman --- src/test/librbd/test_notify.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/test/librbd/test_notify.py b/src/test/librbd/test_notify.py index 8e0bca8a426d3..4d3a7713fa588 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']: -- 2.39.5