]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/workunit/rbd: add test case for --import/export-format in import_export.sh
authorDongsheng Yang <dongsheng.yang@easystack.cn>
Fri, 29 Jul 2016 04:19:54 +0000 (00:19 -0400)
committerDongsheng Yang <dongsheng.yang@easystack.cn>
Sun, 19 Feb 2017 12:42:03 +0000 (20:42 +0800)
Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
qa/workunits/rbd/import_export.sh

index f4e144461b5d88cfe83fab95cdc956f503b1fd3a..f71542cdba02302559335b2a7e49cd0f62cb2e20 100755 (executable)
@@ -74,6 +74,32 @@ cmp ${TMPDIR}/img ${TMPDIR}/img3
 
 rm ${TMPDIR}/img ${TMPDIR}/img2 ${TMPDIR}/img3
 
+# try with --export/import-format for snapshots
+dd if=/bin/dd of=${TMPDIR}/img bs=1k count=10 seek=100
+rbd import $RBD_CREATE_ARGS ${TMPDIR}/img testimg
+rbd snap create testimg@snap
+rbd export --export-format 2 testimg ${TMPDIR}/img_v2
+rbd import --import-format 2 ${TMPDIR}/img_v2 testimg_import
+rbd info testimg_import
+rbd info testimg_import@snap
+
+# compare the contents between testimg and testimg_import
+rbd export testimg_import ${TMPDIR}/img_import
+compare_files_and_ondisk_sizes ${TMPDIR}/img ${TMPDIR}/img_import
+
+rbd export testimg@snap ${TMPDIR}/img_snap
+rbd export testimg_import@snap ${TMPDIR}/img_snap_import
+compare_files_and_ondisk_sizes ${TMPDIR}/img_snap ${TMPDIR}/img_snap_import
+
+rm ${TMPDIR}/img_v2
+rm ${TMPDIR}/img_import
+rm ${TMPDIR}/img_snap
+rm ${TMPDIR}/img_snap_import
+
+rbd snap rm testimg_import@snap
+rbd remove testimg_import
+rbd snap rm testimg@snap
+rbd rm testimg
 
 tiered=0
 if ceph osd dump | grep ^pool | grep "'rbd'" | grep tier; then