]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd/test: add snap protection test for ex/import 20689/head
authorsongweibin <song.weibin@zte.com.cn>
Fri, 2 Mar 2018 09:40:35 +0000 (17:40 +0800)
committersongweibin <song.weibin@zte.com.cn>
Fri, 2 Mar 2018 09:40:35 +0000 (17:40 +0800)
Signed-off-by: songweibin <song.weibin@zte.com.cn>
qa/workunits/rbd/import_export.sh

index deb28051413bc49b90b4d6068648e6b31e97e1b8..7f3e51b55d48e32eff0b527b4767ff6d9c107da7 100755 (executable)
@@ -143,6 +143,25 @@ if rbd help export | grep -q export-format; then
 
     rbd remove testimg_import
     rbd remove testimg
+
+    # snap protect
+    rbd import --image-format=2 ${TMPDIR}/img testimg
+    rbd snap create testimg@snap1
+    rbd snap create testimg@snap2
+    rbd snap protect testimg@snap2
+    rbd export --export-format 2 testimg ${TMPDIR}/snap_protect
+    rbd import --export-format 2 ${TMPDIR}/snap_protect testimg_import
+    rbd info testimg_import@snap1 | grep 'protected: False'
+    rbd info testimg_import@snap2 | grep 'protected: True'
+
+    rm ${TMPDIR}/snap_protect
+
+    rbd snap unprotect testimg@snap2
+    rbd snap unprotect testimg_import@snap2
+    rbd snap purge testimg
+    rbd snap purge testimg_import
+    rbd remove testimg
+    rbd remove testimg_import
 fi
 
 tiered=0