]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: add trash move/restore mirror test 28149/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:44:53 +0000 (15:44 +0300)
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 c2308c355af2404b8288d0abda7562ce38dc7dca..60d11e7cc173ce6a6959e10d82976217100d60b8 100755 (executable)
@@ -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}
 
index 1e086eee3229ee16db13353a748e20d62747c8d7..87170f0c0d823cd7b40a2c711d01bfa56f174197 100755 (executable)
@@ -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