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: v12.2.13~180^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae996c78c336d1d41a90235353a1600d0f4ab14a;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 c2308c355af..60d11e7cc17 100755 --- a/qa/workunits/rbd/rbd_mirror.sh +++ b/qa/workunits/rbd/rbd_mirror.sh @@ -127,6 +127,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_mirror ${CLUSTER2} diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 1e086eee322..87170f0c0d8 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -637,6 +637,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