From: Mykola Golub Date: Fri, 14 Dec 2018 16:47:00 +0000 (+0000) Subject: qa/workunits/rbd: add trash move/restore mirror test X-Git-Tag: v13.2.7~299^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F28150%2Fhead;p=ceph.git qa/workunits/rbd: add trash move/restore mirror test Signed-off-by: Mykola Golub (cherry picked from commit b29b4f0c712cb2a2e97ce3de0b15d9075927b172) --- diff --git a/qa/workunits/rbd/rbd_mirror.sh b/qa/workunits/rbd/rbd_mirror.sh index d3a6e0331b297..7cefd84575028 100755 --- a/qa/workunits/rbd/rbd_mirror.sh +++ b/qa/workunits/rbd/rbd_mirror.sh @@ -131,6 +131,13 @@ wait_for_status_in_pool_dir ${CLUSTER1} ${POOL} ${new_name} 'up+replaying' rename_image ${CLUSTER2} ${POOL} ${new_name} ${image} wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} +testlog "TEST: test trash move restore" +image_id=$(get_image_id ${CLUSTER2} ${POOL} ${image}) +trash_move ${CLUSTER2} ${POOL} ${image} +wait_for_image_present ${CLUSTER1} ${POOL} ${image} 'deleted' +trash_restore ${CLUSTER2} ${POOL} ${image_id} +wait_for_image_replay_started ${CLUSTER1} ${POOL} ${image} + testlog "TEST: failover and failback" start_mirrors ${CLUSTER2} diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index ab4f04d4753b9..f9278185f5fa1 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -745,6 +745,22 @@ remove_image_retry() return 1 } +trash_move() { + local cluster=$1 + local pool=$2 + local image=$3 + + rbd --cluster=${cluster} -p ${pool} trash move ${image} +} + +trash_restore() { + local cluster=$1 + local pool=$2 + local image_id=$3 + + rbd --cluster=${cluster} -p ${pool} trash restore ${image_id} +} + clone_image() { local cluster=$1