From: songweibin Date: Fri, 2 Mar 2018 09:40:35 +0000 (+0800) Subject: rbd/test: add snap protection test for ex/import X-Git-Tag: v13.0.2~41^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2cde7ad65de820e82d681bf9f5fa1c58259f78ce;p=ceph.git rbd/test: add snap protection test for ex/import Signed-off-by: songweibin --- diff --git a/qa/workunits/rbd/import_export.sh b/qa/workunits/rbd/import_export.sh index deb28051413b..7f3e51b55d48 100755 --- a/qa/workunits/rbd/import_export.sh +++ b/qa/workunits/rbd/import_export.sh @@ -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