]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: add trash move/restore mirror test 28150/head
authorMykola Golub <mgolub@suse.com>
Fri, 14 Dec 2018 16:47:00 +0000 (16:47 +0000)
committerMykola Golub <mgolub@suse.com>
Thu, 16 May 2019 12:48:05 +0000 (13:48 +0100)
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit b29b4f0c712cb2a2e97ce3de0b15d9075927b172)

qa/workunits/rbd/rbd_mirror.sh
qa/workunits/rbd/rbd_mirror_helpers.sh

index d3a6e0331b2971c36351d2b71e5fa0357251ceb0..7cefd845750282e38a51ed0c16ac813ad764a9d2 100755 (executable)
@@ -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}
 
index ab4f04d4753b98aeb8cda049093fb87da7df54b4..f9278185f5fa13389e32fd4ac4b9329bbdb9a5f2 100755 (executable)
@@ -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