From: Jason Dillaman Date: Fri, 8 Jul 2016 02:16:51 +0000 (-0400) Subject: qa/workunits/rbd: exercise snapshot renames within rbd-mirror test X-Git-Tag: ses5-milestone5~364^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f4cb26d8bbd1457bc261547103b56ad40b3c464;p=ceph.git qa/workunits/rbd: exercise snapshot renames within rbd-mirror test Snapshot rename operations utilize the (cluster) unique snapshot sequence to prevent attempts at replays. When mirroring to a different cluster, these sequences will not align. Signed-off-by: Jason Dillaman --- diff --git a/qa/workunits/rbd/rbd_mirror.sh b/qa/workunits/rbd/rbd_mirror.sh index 78978124a4d3..f27b46f22910 100755 --- a/qa/workunits/rbd/rbd_mirror.sh +++ b/qa/workunits/rbd/rbd_mirror.sh @@ -188,6 +188,14 @@ for i in ${image2} ${image4}; do compare_images ${POOL} ${i} done +testlog "TEST: snapshot rename" +snap_name='snap_rename' +create_snapshot ${CLUSTER2} ${POOL} ${image2} "${snap_name}_0" +for i in `seq 1 20`; do + rename_snapshot ${CLUSTER2} ${POOL} ${image2} "${snap_name}_$(expr ${i} - 1)" "${snap_name}_${i}" +done +wait_for_snap_present ${CLUSTER1} ${POOL} ${image2} "${snap_name}_${i}" + testlog "TEST: disable mirror while daemon is stopped" stop_mirror ${CLUSTER1} stop_mirror ${CLUSTER2} diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 307705eacda2..2c22327e1d7c 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -529,6 +529,17 @@ remove_snapshot() rbd --cluster ${cluster} -p ${pool} snap rm ${image}@${snap} } +rename_snapshot() +{ + local cluster=$1 + local pool=$2 + local image=$3 + local snap=$4 + local new_snap=$5 + + rbd --cluster ${cluster} -p ${pool} snap rename ${image}@${snap} ${image}@${new_snap} +} + purge_snapshots() { local cluster=$1