From b29b4f0c712cb2a2e97ce3de0b15d9075927b172 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Fri, 14 Dec 2018 16:47:00 +0000 Subject: [PATCH] qa/workunits/rbd: add trash move/restore mirror test Signed-off-by: Mykola Golub --- qa/workunits/rbd/rbd_mirror.sh | 7 +++++++ qa/workunits/rbd/rbd_mirror_helpers.sh | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/qa/workunits/rbd/rbd_mirror.sh b/qa/workunits/rbd/rbd_mirror.sh index 433fb33a825b5..80d7b5deafd96 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 f92b575ae8533..ea50078ddc2e1 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -785,6 +785,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 -- 2.39.5