Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / qa / workunits / fs / snaps / snaptest-xattrwb.sh
1 #!/bin/sh -x
2
3 set -e
4
5 ceph mds set allow_new_snaps true --yes-i-really-mean-it
6
7 echo "testing simple xattr wb"
8 touch x
9 setfattr -n user.foo x
10 mkdir .snap/s1
11 getfattr -n user.foo .snap/s1/x | grep user.foo
12 rm x
13 rmdir .snap/s1
14
15 echo "testing wb with pre-wb server cow"
16 mkdir a
17 mkdir a/b
18 mkdir a/b/c
19 # b now has As but not Ax
20 setfattr -n user.foo a/b
21 mkdir a/.snap/s
22 mkdir a/b/cc
23 # b now has been cowed on the server, but we still have dirty xattr caps
24 getfattr -n user.foo a/b          # there they are...
25 getfattr -n user.foo a/.snap/s/b | grep user.foo  # should be there, too!
26
27 # ok, clean up
28 rmdir a/.snap/s
29 rm -r a
30
31 echo OK