]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: added snap protect/unprotect and rename to client update test
authorJason Dillaman <dillaman@redhat.com>
Tue, 25 Aug 2015 17:34:12 +0000 (13:34 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 19 Nov 2015 01:34:42 +0000 (20:34 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librbd/test_notify.py

index 8e0bca8a426d37e7be9c2c996505b16a32e04a80..4d3a7713fa5889f2b6816b751d22d96f3c8a5c92 100755 (executable)
@@ -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']: