]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/pybind/rbd.pyx: add test_remove_snap_by_id case in test_rbd.py 30927/head
authorzhangjiao <zhangjiao@cmss.chinamobile.com>
Tue, 15 Oct 2019 07:49:33 +0000 (15:49 +0800)
committerzhangjiao <zhangjiao@cmss.chinamobile.com>
Tue, 15 Oct 2019 07:49:33 +0000 (15:49 +0800)
Signed-off-by: Zhang Jiao <zhangjiao@cmss.chinamobile.com>
src/test/pybind/test_rbd.py

index 1f2a5b8ddd862d0a54aabc1e6a85937b6c90d65e..b86b0d12424fc50128d28eace876d362b4c1d532 100644 (file)
@@ -747,6 +747,15 @@ class TestImage(object):
         self.image.remove_snap('snap1')
         eq([], list(self.image.list_snaps()))
 
+    def test_remove_snap_by_id(self):
+       eq([], list(self.image.list_snaps()))
+       self.image.create_snap('snap1')
+       eq(['snap1'], [snap['name'] for snap in self.image.list_snaps()])
+       for snap in self.image.list_snaps():
+           snap_id = snap["id"]
+       self.image.remove_snap_by_id(snap_id)
+       eq([], list(self.image.list_snaps()))
+
     def test_rename_snap(self):
         eq([], list(self.image.list_snaps()))
         self.image.create_snap('snap1')