]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rbd: exercise snapshot renames within rbd-mirror test
authorJason Dillaman <dillaman@redhat.com>
Fri, 8 Jul 2016 02:16:51 +0000 (22:16 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 17 Aug 2016 17:22:04 +0000 (13:22 -0400)
Snapshot rename operations utilize the (cluster) unique snapshot
sequence to prevent attempts at replays. When mirroring to a
different cluster, these sequences will not align.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 2f4cb26d8bbd1457bc261547103b56ad40b3c464)

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

index 14f27785671c2e01a5b449d5422d4f1b31c6670b..7e01eeabd55f10aa17099e4f8f83e166fcc77f09 100755 (executable)
@@ -186,6 +186,14 @@ for i in ${image2} ${image4}; do
   compare_images ${POOL} ${i}
 done
 
+testlog "TEST: snapshot rename"
+snap_name='snap_rename'
+create_snapshot ${CLUSTER2} ${POOL} ${image2} "${snap_name}_0"
+for i in `seq 1 20`; do
+  rename_snapshot ${CLUSTER2} ${POOL} ${image2} "${snap_name}_$(expr ${i} - 1)" "${snap_name}_${i}"
+done
+wait_for_snap_present ${CLUSTER1} ${POOL} ${image2} "${snap_name}_${i}"
+
 testlog "TEST: disable mirror while daemon is stopped"
 stop_mirror ${CLUSTER1}
 stop_mirror ${CLUSTER2}
index 9478cc8f9d1c209edd71c9d4f1e035451ae37bd8..3648e2ae8b51c880054374eb6302a6fd0b8dbee1 100755 (executable)
@@ -514,6 +514,17 @@ remove_snapshot()
     rbd --cluster ${cluster} -p ${pool} snap rm ${image}@${snap}
 }
 
+rename_snapshot()
+{
+    local cluster=$1
+    local pool=$2
+    local image=$3
+    local snap=$4
+    local new_snap=$5
+
+    rbd --cluster ${cluster} -p ${pool} snap rename ${image}@${snap} ${image}@${new_snap}
+}
+
 purge_snapshots()
 {
     local cluster=$1