]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #!/bin/sh |
2 | ||
3 | set -e | |
4 | ||
11fdf7f2 | 5 | ceph fs set cephfs allow_new_snaps true --yes-i-really-mean-it |
7c673cae FG |
6 | |
7 | echo "making directory tree and files" | |
8 | mkdir -p 1/a/b/c/ | |
9 | echo "i'm file1" > 1/a/file1 | |
10 | echo "i'm file2" > 1/a/b/file2 | |
11 | echo "i'm file3" > 1/a/b/c/file3 | |
12 | echo "snapshotting" | |
13 | mkdir 1/.snap/foosnap1 | |
14 | mkdir 2 | |
15 | echo "moving tree" | |
16 | mv 1/a 2 | |
17 | echo "checking snapshot contains tree..." | |
18 | dir1=`find 1/.snap/foosnap1 | wc -w` | |
19 | dir2=`find 2/ | wc -w` | |
20 | #diff $dir1 $dir2 && echo "Success!" | |
21 | test $dir1==$dir2 && echo "Success!" | |
22 | echo "adding folder and file to tree..." | |
23 | mkdir 2/a/b/c/d | |
24 | echo "i'm file 4!" > 2/a/b/c/d/file4 | |
25 | echo "snapshotting tree 2" | |
26 | mkdir 2/.snap/barsnap2 | |
27 | echo "comparing snapshots" | |
28 | dir1=`find 1/.snap/foosnap1/ -maxdepth 2 | wc -w` | |
29 | dir2=`find 2/.snap/barsnap2/ -maxdepth 2 | wc -w` | |
30 | #diff $dir1 $dir2 && echo "Success!" | |
31 | test $dir1==$dir2 && echo "Success!" | |
32 | echo "moving subtree to first folder" | |
33 | mv 2/a/b/c 1 | |
34 | echo "comparing snapshots and new tree" | |
35 | dir1=`find 1/ | wc -w` | |
36 | dir2=`find 2/.snap/barsnap2/a/b/c | wc -w` | |
37 | #diff $dir1 $dir2 && echo "Success!" | |
11fdf7f2 | 38 | test $dir1==$dir2 && echo "Success!" |
7c673cae FG |
39 | rmdir 1/.snap/* |
40 | rmdir 2/.snap/* | |
41 | echo "OK" |