Skip to content

Commit

Permalink
qa: add dir rename tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
Sage Weil committed Jun 8, 2011
1 parent 00ec86a commit 21795aa
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 28 deletions.
7 changes: 7 additions & 0 deletions qa/mds/rename/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@ rm mnt/?/* || true

$dir/rem_rem.sh
rm mnt/?/* || true

$dir/pri_nul.sh
rm -r mnt/?/* || true

$dir/pri_pri.sh
rm -r mnt/?/* || true

21 changes: 21 additions & 0 deletions qa/mds/rename/dir_pri_nul.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh -ex

# dir: srcdn=destdn
mkdir mnt/a/dir1
mv mnt/a/dir1 mnt/a/dir1.renamed

# dir: diff
mkdir mnt/a/dir2
mv mnt/a/dir2 mnt/b/dir2

# dir: diff, child subtree on target
mkdir -p mnt/a/dir3/child/foo
./ceph mds tell 0 export_dir /a/dir3/child 1
sleep 5
mv mnt/a/dir3 mnt/b/dir3

# dir: diff, child subtree on other
mkdir -p mnt/a/dir4/child/foo
./ceph mds tell 0 export_dir /a/dir4/child 2
sleep 5
mv mnt/a/dir4 mnt/b/dir4
11 changes: 11 additions & 0 deletions qa/mds/rename/dir_pri_pri.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh -ex

# dir, srcdn=destdn
mkdir mnt/a/dir1
mkdir mnt/a/dir2
mv -T mnt/a/dir1 mnt/a/dir2

# dir, different
mkdir mnt/a/dir3
mkdir mnt/b/dir4
mv -T mnt/a/dir3 mnt/b/dir4
19 changes: 0 additions & 19 deletions qa/mds/rename/pri_nul.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,4 @@ mv mnt/a/file1 mnt/a/file1.renamed
touch mnt/a/file2
mv mnt/a/file2 mnt/b

# dir: srcdn=destdn
mkdir mnt/a/dir1
mv mnt/a/dir1 mnt/a/dir1.renamed

# dir: diff
mkdir mnt/a/dir2
mv mnt/a/dir2 mnt/b/dir2

# dir: diff, child subtree on target
mkdir -p mnt/a/dir3/child/foo
./ceph mds tell 0 export_dir /a/dir3/child 1
sleep 5
mv mnt/a/dir3 mnt/b/dir3

# dir: diff, child subtree on other
mkdir -p mnt/a/dir4/child/foo
./ceph mds tell 0 export_dir /a/dir4/child 2
sleep 5
mv mnt/a/dir4 mnt/b/dir4

9 changes: 0 additions & 9 deletions qa/mds/rename/pri_pri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,3 @@ touch mnt/a/file3
touch mnt/b/file4
mv mnt/a/file3 mnt/b/file4

# dir, srcdn=destdn
mkdir mnt/a/dir1
mkdir mnt/a/dir2
mv -T mnt/a/dir1 mnt/a/dir2

# dir, different
mkdir mnt/a/dir3
mkdir mnt/b/dir4
mv -T mnt/a/dir3 mnt/b/dir4

0 comments on commit 21795aa

Please sign in to comment.