From: Josh Durgin Date: Fri, 29 Jun 2012 21:24:36 +0000 (-0700) Subject: qa: add rbd remove tests X-Git-Tag: v0.50~104^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d82a502680c7bf726a73f4f4585370cb45f82d4d;p=ceph.git 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 --- diff --git a/qa/workunits/rbd/copy.sh b/qa/workunits/rbd/copy.sh index c1f1c6000bbe..706223b6c4bd 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