~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to qa/workunits/snaps/snaptest-parents.sh

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
set -e
 
4
 
 
5
echo "making directory tree and files"
 
6
mkdir -p 1/a/b/c/
 
7
echo "i'm file1" > 1/a/file1
 
8
echo "i'm file2" > 1/a/b/file2
 
9
echo "i'm file3" > 1/a/b/c/file3
 
10
echo "snapshotting"
 
11
mkdir 1/.snap/foosnap1
 
12
mkdir 2
 
13
echo "moving tree"
 
14
mv 1/a 2
 
15
echo "checking snapshot contains tree..."
 
16
dir1=`find 1/.snap/foosnap1 | wc -w`
 
17
dir2=`find 2/ | wc -w`
 
18
#diff $dir1 $dir2 && echo "Success!"
 
19
test $dir1==$dir2 && echo "Success!"
 
20
echo "adding folder and file to tree..."
 
21
mkdir 2/a/b/c/d
 
22
echo "i'm file 4!" > 2/a/b/c/d/file4
 
23
echo "snapshotting tree 2"
 
24
mkdir 2/.snap/barsnap2
 
25
echo "comparing snapshots"
 
26
dir1=`find 1/.snap/foosnap1/ -maxdepth 2 | wc -w`
 
27
dir2=`find 2/.snap/barsnap2/ -maxdepth 2 | wc -w`
 
28
#diff $dir1 $dir2 && echo "Success!"
 
29
test $dir1==$dir2 && echo "Success!"
 
30
echo "moving subtree to first folder"
 
31
mv 2/a/b/c 1
 
32
echo "comparing snapshots and new tree"
 
33
dir1=`find 1/ | wc -w`
 
34
dir2=`find 2/.snap/barsnap2/a/b/c | wc -w`
 
35
#diff $dir1 $dir2 && echo "Success!"
 
36
test $dir1==$dir2 && echo "Sucess!"
 
37
echo "OK"
 
 
b'\\ No newline at end of file'