Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / qa / workunits / fs / snaps / snaptest-snap-rm-cmp.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 file=linux-2.6.33.tar.bz2
8 wget -q http://download.ceph.com/qa/$file
9
10 real=`md5sum $file | awk '{print $1}'`
11
12 for f in `seq 1 20`
13 do
14     echo $f
15     cp $file a
16     mkdir .snap/s
17     rm a
18     cp .snap/s/a /tmp/a
19     cur=`md5sum /tmp/a | awk '{print $1}'`
20     if [ "$cur" != "$real" ]; then
21         echo "FAIL: bad match, /tmp/a $cur != real $real"
22         false
23     fi
24     rmdir .snap/s
25 done
26 rm $file