]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/workunits/rbd: add trash move/restore mirror test
authorMykola Golub <mgolub@suse.com>
Fri, 14 Dec 2018 16:47:00 +0000 (16:47 +0000)
committerMykola Golub <mgolub@suse.com>
Fri, 14 Dec 2018 16:47:15 +0000 (16:47 +0000)
Signed-off-by: Mykola Golub <mgolub@suse.com>
qa/workunits/rbd/rbd_mirror.sh
qa/workunits/rbd/rbd_mirror_helpers.sh

index 433fb33a825b5cb650366a9ddb708810916c312a..80d7b5deafd967651635eb7a9b3bf028808b0ac7 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 f92b575ae85338c0cdcc0c1e57286227cc2189f8..ea50078ddc2e1344a7a12d3652525bef64a69ede 100755 (executable)
@@ -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