]> git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/fs/test-volumes.sh
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / qa / workunits / fs / test-volumes.sh
1 #!/bin/bash -ex
2
3 function expect_false()
4 {
5 set -x
6 if "$@"; then return 1; else return 0; fi
7 }
8
9 # make sure we can do multiple file systems
10 ceph fs flag set enable_multiple true --yes-i-really-mean-it
11
12 # create a volume if one doesn't exist
13 if `ceph fs volume ls | jq 'length'` -eq 0 ; then
14 EXISTING='foo'
15 ceph fs volume create $EXISTING
16 else
17 EXISTING=`ceph fs volume ls | jq -r '.[0].name'`
18 fi
19
20
21
22 # create and remove volumes
23 if ceph fs volume ls | grep bar; then
24 echo 'uh, volume bar already exists, bailing'
25 exit 1
26 fi
27 ceph fs volume create bar
28 ceph fs volume ls | grep bar
29 ceph fs volume rm bar
30
31 # subvolumes on $EXISTING
32 ceph fs subvolume create $EXISTING sub1
33 ceph fs subvolume create $EXISTING sub2
34 ceph fs subvolume rm $EXISTING sub2
35 ceph fs subvolume rm $EXISTING sub1
36
37 echo OK