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