Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / qa / workunits / fs / snaps / snaptest-1.sh
1 #!/bin/bash -x
2
3 set -e
4
5 ceph mds set allow_new_snaps true --yes-i-really-mean-it
6
7 echo 1 > file1
8 echo 2 > file2
9 echo 3 > file3
10 [ -e file4 ] && rm file4
11 mkdir .snap/snap1
12 echo 4 > file4
13 now=`ls`
14 then=`ls .snap/snap1`
15 rmdir .snap/snap1
16 if [ "$now" = "$then" ]; then
17     echo live and snap contents are identical?
18     false
19 fi
20
21 # do it again
22 echo 1 > file1
23 echo 2 > file2
24 echo 3 > file3
25 mkdir .snap/snap1
26 echo 4 > file4
27 rmdir .snap/snap1
28
29 rm file?
30
31 echo OK