From: Sage Weil Date: Wed, 28 Nov 2018 14:50:00 +0000 (-0600) Subject: qa: add simple test-volumes.sh workunit and run it from fs/basic_functional X-Git-Tag: v14.1.0~776^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=43bf12e12dd07de0fb58dc6b7d5baf0119b48436;p=ceph.git qa: add simple test-volumes.sh workunit and run it from fs/basic_functional Signed-off-by: Sage Weil --- diff --git a/qa/suites/fs/basic_functional/tasks/volumes.yaml b/qa/suites/fs/basic_functional/tasks/volumes.yaml new file mode 100644 index 000000000000..cd48732eb3fb --- /dev/null +++ b/qa/suites/fs/basic_functional/tasks/volumes.yaml @@ -0,0 +1,5 @@ +tasks: + - workunit: + clients: + client.0: + - fs/test-volumes.sh diff --git a/qa/workunits/fs/test-volumes.sh b/qa/workunits/fs/test-volumes.sh new file mode 100755 index 000000000000..00507c5d14c8 --- /dev/null +++ b/qa/workunits/fs/test-volumes.sh @@ -0,0 +1,37 @@ +#!/bin/bash -ex + +function expect_false() +{ + set -x + if "$@"; then return 1; else return 0; fi +} + +# make sure we can do multiple file systems +ceph fs flag set enable_multiple true --yes-i-really-mean-it + +# create a volume if one doesn't exist +if `ceph fs volume ls | jq 'length'` -eq 0 ; then + EXISTING='foo' + ceph fs volume create $EXISTING +else + EXISTING=`ceph fs volume ls | jq -r '.[0].name'` +fi + + + +# create and remove volumes +if ceph fs volume ls | grep bar; then + echo 'uh, volume bar already exists, bailing' + exit 1 +fi +ceph fs volume create bar +ceph fs volume ls | grep bar +ceph fs volume rm bar + +# subvolumes on $EXISTING +ceph fs subvolume create $EXISTING sub1 +ceph fs subvolume create $EXISTING sub2 +ceph fs subvolume rm $EXISTING sub2 +ceph fs subvolume rm $EXISTING sub1 + +echo OK