]> git.apps.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>
Tue, 19 Jul 2016 13:27:32 +0000 (09:27 -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>
qa/workunits/rbd/rbd_mirror.sh
qa/workunits/rbd/rbd_mirror_helpers.sh

index 78978124a4d3c83757e3ce0641efe322240a2adc..f27b46f22910c4bfdd5a1debb156b5d35b69d51b 100755 (executable)
@@ -188,6 +188,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 307705eacda2033716ecb4ea9b59d287171c0f80..2c22327e1d7cdac588bdfc20be7c15d56c159027 100755 (executable)
@@ -529,6 +529,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