]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: fix qa tests to use --allow-shrink
authorSage Weil <sage@inktank.com>
Fri, 19 Apr 2013 21:08:51 +0000 (14:08 -0700)
committerSage Weil <sage@inktank.com>
Fri, 19 Apr 2013 21:37:21 +0000 (14:37 -0700)
Fixes: #4763
Signed-off-by: Sage Weil <sage@inktank.com>
qa/workunits/rbd/copy.sh
qa/workunits/rbd/kernel.sh
qa/workunits/rbd/permissions.sh

index a3334c073d6adc00dd80b2ee4d08008e842ef5ee..8430fca766565f96c70c1441daffb4d58353e9a3 100755 (executable)
@@ -29,10 +29,11 @@ test_others() {
 
     # import, snapshot
     rbd import $RBD_CREATE_ARGS /tmp/img1 testimg1
-    rbd resize testimg1 --size=256
+    rbd resize testimg1 --size=256 --allow-shrink
     rbd export testimg1 /tmp/img2
     rbd snap create testimg1 --snap=snap1
-    rbd resize testimg1 --size=128
+    rbd resize testimg1 --size=128 && exit 1 || true   # shrink should fail
+    rbd resize testimg1 --size=128 --allow-shrink
     rbd export testimg1 /tmp/img3
 
     # info
index 73f3dcb6b41422f3575916eb93619b154e4b346b..3786de161ecdbeee382c3f4b8bf7289ffeb37510 100755 (executable)
@@ -72,7 +72,7 @@ sudo dd if=/dev/rbd/rbd/testimg1@snap1 of=/tmp/img1.snap1
 cmp /tmp/img1 /tmp/img1.snap1
 
 # resize
-rbd resize testimg1 --size=40
+rbd resize testimg1 --size=40 --allow-shrink
 echo 1 | sudo tee /sys/bus/rbd/devices/$DEV_ID1/refresh
 cat /sys/bus/rbd/devices/$DEV_ID1/size | grep 41943040
 echo 1 | sudo tee /sys/bus/rbd/devices/$DEV_ID2/refresh
index 74c24c03c2b2f684ebb9011b3933c00b1465dc50..a4b0c32fdee6e0c5a111c2f6a71007c0be673b5f 100755 (executable)
@@ -64,7 +64,7 @@ test_volumes_access() {
     rbd -k $KEYRING --id volumes lock list images/foo
 
     # commands that fail with read-only access
-    ! rbd -k $KEYRING --id volumes resize -s 2 images/foo
+    ! rbd -k $KEYRING --id volumes resize -s 2 images/foo --allow-shrink
     ! rbd -k $KEYRING --id volumes snap create images/foo@2
     ! rbd -k $KEYRING --id volumes snap rollback images/foo@snap
     ! rbd -k $KEYRING --id volumes snap remove images/foo@snap