diff options
author | Josh Durgin <josh.durgin@inktank.com> | 2012-06-29 23:24:36 +0200 |
---|---|---|
committer | Josh Durgin <josh.durgin@inktank.com> | 2012-07-02 23:18:21 +0200 |
commit | d82a502680c7bf726a73f4f4585370cb45f82d4d (patch) | |
tree | 7aba813d083da4958be5cc69449efb80c7b3ddfd /qa | |
parent | cls_rbd_client: check return code of operate (diff) | |
download | ceph-d82a502680c7bf726a73f4f4585370cb45f82d4d.tar.xz ceph-d82a502680c7bf726a73f4f4585370cb45f82d4d.zip |
qa: add rbd remove tests
These check that removing an image still works if an rbd rm
command was interrupted partway through.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'qa')
-rwxr-xr-x | qa/workunits/rbd/copy.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/qa/workunits/rbd/copy.sh b/qa/workunits/rbd/copy.sh index c1f1c6000bb..706223b6c4b 100755 --- a/qa/workunits/rbd/copy.sh +++ b/qa/workunits/rbd/copy.sh @@ -110,8 +110,47 @@ test_ls() { remove_images } +test_remove() { + echo "testing remove..." + remove_images + + rbd create -s 1 test1 + rbd rm test1 + rbd ls | wc -l | grep "^0$" + + rbd create --new-format -s 1 test2 + rbd rm test2 + rbd ls | wc -l | grep "^0$" + + # check that remove succeeds even if it's + # interrupted partway through. simulate this + # by removing some objects manually. + + # remove with header missing (old format) + rbd create -s 1 test1 + rados rm -p rbd test1.rbd + rbd rm test1 + rbd ls | wc -l | grep "^0$" + + # remove with header missing + rbd create --new-format -s 1 test2 + HEADER=$(rados -p rbd ls | grep '^rbd_header') + rados -p rbd rm $HEADER + rbd rm test2 + rbd ls | wc -l | grep "^0$" + + # remove with header and id missing + rbd create --new-format -s 1 test2 + HEADER=$(rados -p rbd ls | grep '^rbd_header') + rados -p rbd rm $HEADER + rados -p rbd rm rbd_id.test2 + rbd rm test2 + rbd ls | wc -l | grep "^0$" +} + test_rename test_ls +test_remove RBD_CREATE_ARGS="" test_others # wait for watch to timeout so we can remove old images |