Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / qa / workunits / fs / snaps / snaptest-capwb.sh
1 #!/bin/sh -x
2
3 set -e
4
5 mkdir foo
6
7 ceph mds set allow_new_snaps true --yes-i-really-mean-it
8
9 # make sure mds handles it when the client does not send flushsnap
10 echo x > foo/x
11 sync
12 mkdir foo/.snap/ss
13 ln foo/x foo/xx
14 cat foo/.snap/ss/x
15 rmdir foo/.snap/ss
16
17 #
18 echo a > foo/a
19 echo b > foo/b
20 mkdir foo/.snap/s
21 r=`cat foo/.snap/s/a`
22 [ -z "$r" ] && echo "a appears empty in snapshot" && false
23
24 ln foo/b foo/b2
25 cat foo/.snap/s/b
26
27 echo "this used to hang:"
28 echo more >> foo/b2
29 echo "oh, it didn't hang! good job."
30 cat foo/b
31 rmdir foo/.snap/s
32
33 rm -r foo
34
35 echo OK