summaryrefslogtreecommitdiffstats
path: root/qa/workunits/fs/snaps/snaptest-1.sh
blob: 431e83387899d8866574870cdbaf4d01eef3b4a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash

set -ex

echo 1 > file1
echo 2 > file2
echo 3 > file3
[ -e file4 ] && rm file4
mkdir .snap/snap1
echo 4 > file4
now=`ls`
then=`ls .snap/snap1`
rmdir .snap/snap1
if [ "$now" = "$then" ]; then
    echo live and snap contents are identical?
    false
fi

# do it again
echo 1 > file1
echo 2 > file2
echo 3 > file3
mkdir .snap/snap1
echo 4 > file4
rmdir .snap/snap1

rm file?

echo OK