]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/pybind: add create_snap rasie ImageExists test case 31140/head
authorGangbiao Liu <liugangbiao@cmss.chinamobile.com>
Wed, 23 Oct 2019 02:26:02 +0000 (10:26 +0800)
committerGangbiao Liu <liugangbiao@cmss.chinamobile.com>
Tue, 29 Oct 2019 15:25:33 +0000 (23:25 +0800)
Signed-off-by: Gangbiao Liu <liugangbiao@cmss.chinamobile.com>
src/test/pybind/test_rbd.py

index 77c0e2df353d710b67b0af386fe92bbaa438b6e7..2795d90133490e0abda662e581bb6d04cd22a50f 100644 (file)
@@ -741,6 +741,11 @@ class TestImage(object):
         eq(snap_data, b'\0' * 256)
         self.image.remove_snap('snap1')
 
+    def test_create_snap_exists(self):
+        self.image.create_snap('snap1')
+        assert_raises(ImageExists, self.image.create_snap, 'snap1')
+        self.image.remove_snap('snap1')
+
     def test_list_snaps(self):
         eq([], list(self.image.list_snaps()))
         self.image.create_snap('snap1')