From 2cde7ad65de820e82d681bf9f5fa1c58259f78ce Mon Sep 17 00:00:00 2001 From: songweibin Date: Fri, 2 Mar 2018 17:40:35 +0800 Subject: [PATCH] rbd/test: add snap protection test for ex/import Signed-off-by: songweibin --- qa/workunits/rbd/import_export.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/qa/workunits/rbd/import_export.sh b/qa/workunits/rbd/import_export.sh index deb28051413..7f3e51b55d4 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 -- 2.47.3