summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-03-26 23:16:54 -0700
committerJosh Durgin <josh.durgin@inktank.com>2013-03-31 23:32:40 -0700
commit58c2deddedc36cccda3ac19f06bf3e7d8c8608c7 (patch)
tree7b309c8bd8814fcadd565e912b9ec1696b543343 /qa
parente7167433aef5e404fe05b525f7840f9e2c52501f (diff)
downloadceph-58c2deddedc36cccda3ac19f06bf3e7d8c8608c7.tar.gz
qa: add rbd/diff_continuous.sh stress test
Stress test that does io on an image while we are mirroring a diff from earlier snaps to a second copy. At the end, verify that all snaps have matching content. Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'qa')
-rwxr-xr-xqa/workunits/rbd/diff_continuous.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/qa/workunits/rbd/diff_continuous.sh b/qa/workunits/rbd/diff_continuous.sh
new file mode 100755
index 00000000000..b7f4dc01ade
--- /dev/null
+++ b/qa/workunits/rbd/diff_continuous.sh
@@ -0,0 +1,51 @@
+#!/bin/bash -ex
+
+max=30
+size=1500
+
+iosize=16384
+iototal=16384000
+iothreads=16
+
+src=`uuidgen`"-src";
+dst=`uuidgen`"-dst";
+
+function cleanup() {
+ rbd snap purge $src || :
+ rbd rm $src || :
+ rbd snap purge $dst || :
+ rbd rm $dst || :
+}
+trap cleanup EXIT
+
+rbd create $src --size $size
+rbd create $dst --size $size
+
+# mirror for a while
+
+rbd snap create $src --snap=snap0
+rbd bench-write $src --io-size $iosize --io-threads $iothreads --io-total $iototal --io-pattern rand
+lastsnap=snap0
+for s in `seq 1 $max`; do
+ rbd snap create $src --snap=snap$s
+ rbd export-diff $src@snap$s - --from-snap $lastsnap | rbd import-diff - $dst &
+ rbd bench-write $src --io-size $iosize --io-threads $iothreads --io-total $iototal --io-pattern rand &
+ wait
+ lastsnap=snap$s
+done
+
+# validate
+for s in `seq 1 $max`; do
+ ssum=`rbd export $src@snap$s - | md5sum`
+ dsum=`rbd export $dst@snap$s - | md5sum`
+ if [ "$ssum" != "$dsum" ]; then
+ echo different sum at snap$s
+ exit 1
+ fi
+done
+
+cleanup
+trap "" EXIT
+
+echo OK
+