diff options
author | Alex Elder <elder@inktank.com> | 2013-05-21 10:05:03 -0500 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2013-05-21 14:44:38 -0500 |
commit | 7ad5cebae16dd725547df3c30558974f0825d262 (patch) | |
tree | 78a6bd4d5cceeb776d14fdc4c484996a813f4f16 /qa | |
parent | a6b4847ef27a3e956074fa7be6ed13de9bc4009b (diff) | |
download | ceph-7ad5cebae16dd725547df3c30558974f0825d262.tar.gz |
rbd image_read.sh: add clone-of-clone testing
Add testing to verify that a snapshot of a clone and a clone of
that snapshot both produce the correct results when read.
Signed-off-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'qa')
-rwxr-xr-x | qa/workunits/rbd/image_read.sh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/qa/workunits/rbd/image_read.sh b/qa/workunits/rbd/image_read.sh index 6fbe0c92bae..11ec6770532 100755 --- a/qa/workunits/rbd/image_read.sh +++ b/qa/workunits/rbd/image_read.sh @@ -31,7 +31,9 @@ # # Clone functionality is tested as well, in which case a clone is # made of the snapshot, and the same ranges of data are again read -# and compared with the original. +# and compared with the original. In addition, a snapshot of that +# clone is created, and a clone of *that* snapshot is put through +# the same set of tests. (Clone testing can be optionally skipped.) ################################################################ @@ -56,6 +58,8 @@ PROGNAME=$(basename $0) ORIGINAL=original-$$ SNAP1=snap1-$$ CLONE1=clone1-$$ +SNAP2=snap2-$$ +CLONE2=clone2-$$ function err() { if [ $# -gt 0 ]; then @@ -211,20 +215,38 @@ function setup() { sudo chown ubuntu /sys/bus/rbd/add sudo chown ubuntu /sys/bus/rbd/remove fi + # create and fill the original image with some data create_image "${ORIGINAL}" map_image "${ORIGINAL}" fill_original + + # create a snapshot of the original create_image_snap "${ORIGINAL}" "${SNAP1}" map_image_snap "${ORIGINAL}" "${SNAP1}" if [ "${TEST_CLONES}" = true ]; then + # create a clone of the original snapshot create_snap_clone "${ORIGINAL}" "${SNAP1}" "${CLONE1}" map_image "${CLONE1}" + + # create a snapshot of that clone + create_image_snap "${CLONE1}" "${SNAP2}" + map_image_snap "${CLONE1}" "${SNAP2}" + + # create a clone of that clone's snapshot + create_snap_clone "${CLONE1}" "${SNAP2}" "${CLONE2}" + map_image "${CLONE2}" fi } function teardown() { verbose "===== cleaning up =====" if [ "${TEST_CLONES}" = true ]; then + unmap_image "${CLONE2}" || true + destroy_snap_clone "${CLONE1}" "${SNAP2}" "${CLONE2}" || true + + unmap_image_snap "${CLONE1}" "${SNAP2}" || true + destroy_image_snap "${CLONE1}" "${SNAP2}" || true + unmap_image "${CLONE1}" || true destroy_snap_clone "${ORIGINAL}" "${SNAP1}" "${CLONE1}" || true fi @@ -608,6 +630,8 @@ run_using "${ORIGINAL}" doit "${ORIGINAL}@${SNAP1}" if [ "${TEST_CLONES}" = true ]; then doit "${CLONE1}" + doit "${CLONE1}@${SNAP2}" + doit "${CLONE2}" fi rm -rf $(out_data_dir "${ORIGINAL}") |