Skip to content

Commit

Permalink
qa: mds rename: Rework so it will function in teuthology as a workunit:
Browse files Browse the repository at this point in the history
work in current directory, not hardcoded mnt path
use CEPH_TOOL variable rather than hardcoded local executable
pass CEPH_ARGS to scripts so you don't need to export it into the environment.

Signed-off-by: Greg Farnum <[email protected]>
  • Loading branch information
gregsfortytwo committed Jul 6, 2011
1 parent 528b615 commit e483bb6
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 72 deletions.
33 changes: 18 additions & 15 deletions qa/mds/rename/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@

dir=`dirname $0`

$dir/prepare.sh
CEPH_TOOL='./ceph'
$CEPH_TOOL || CEPH_TOOL='ceph'

$dir/pri_nul.sh
rm mnt/?/* || true
CEPH_ARGS=$CEPH_ARGS CEPH_TOOL=$CEPH_TOOL $dir/prepare.sh

$dir/rem_nul.sh
rm mnt/?/* || true
CEPH_ARGS=$CEPH_ARGS CEPH_TOOL=$CEPH_TOOL $dir/pri_nul.sh
rm ./?/* || true

$dir/pri_pri.sh
rm mnt/?/* || true
CEPH_ARGS=$CEPH_ARGS CEPH_TOOL=$CEPH_TOOL $dir/rem_nul.sh
rm ./?/* || true

$dir/rem_pri.sh
rm mnt/?/* || true
CEPH_ARGS=$CEPH_ARGS CEPH_TOOL=$CEPH_TOOL $dir/pri_pri.sh
rm ./?/* || true

$dir/rem_rem.sh
rm mnt/?/* || true
CEPH_ARGS=$CEPH_ARGS CEPH_TOOL=$CEPH_TOOL $dir/rem_pri.sh
rm ./?/* || true

$dir/pri_nul.sh
rm -r mnt/?/* || true
CEPH_ARGS=$CEPH_ARGS CEPH_TOOL=$CEPH_TOOL $dir/rem_rem.sh
rm ./?/* || true

$dir/pri_pri.sh
rm -r mnt/?/* || true
CEPH_ARGS=$CEPH_ARGS CEPH_TOOL=$CEPH_TOOL $dir/pri_nul.sh
rm -r ./?/* || true

CEPH_ARGS=$CEPH_ARGS CEPH_TOOL=$CEPH_TOOL $dir/pri_pri.sh
rm -r ./?/* || true

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

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

# dir: diff
mkdir mnt/a/dir2
mv mnt/a/dir2 mnt/b/dir2
mkdir ./a/dir2
mv ./a/dir2 ./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
mkdir -p ./a/dir3/child/foo
$CEPH_TOOL mds tell 0 export_dir /a/dir3/child 1
sleep 5
mv mnt/a/dir3 mnt/b/dir3
mv ./a/dir3 ./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
mkdir -p ./a/dir4/child/foo
$CEPH_TOOL mds tell 0 export_dir /a/dir4/child 2
sleep 5
mv mnt/a/dir4 mnt/b/dir4
mv ./a/dir4 ./b/dir4

# dir: witness subtree adjustment
mkdir -p mnt/a/dir5/1/2/3/4
./ceph mds tell 0 export_dir /a/dir5/1/2/3 2
mkdir -p ./a/dir5/1/2/3/4
$CEPH_TOOL mds tell 0 export_dir /a/dir5/1/2/3 2
sleep 5
mv mnt/a/dir5 mnt/b
mv ./a/dir5 ./b

12 changes: 6 additions & 6 deletions qa/mds/rename/dir_pri_pri.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh -ex

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

# dir, different
mkdir mnt/a/dir3
mkdir mnt/b/dir4
mv -T mnt/a/dir3 mnt/b/dir4
mkdir ./a/dir3
mkdir ./b/dir4
mv -T ./a/dir3 ./b/dir4
24 changes: 12 additions & 12 deletions qa/mds/rename/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/sh -ex

./ceph mds tell 0 injectargs '--mds-bal-interval 0'
./ceph mds tell 1 injectargs '--mds-bal-interval 0'
./ceph mds tell 2 injectargs '--mds-bal-interval 0'
./ceph mds tell 3 injectargs '--mds-bal-interval 0'
#./ceph mds tell 4 injectargs '--mds-bal-interval 0'
$CEPH_TOOL mds tell 0 injectargs '--mds-bal-interval 0'
$CEPH_TOOL mds tell 1 injectargs '--mds-bal-interval 0'
$CEPH_TOOL mds tell 2 injectargs '--mds-bal-interval 0'
$CEPH_TOOL mds tell 3 injectargs '--mds-bal-interval 0'
#$CEPH_TOOL mds tell 4 injectargs '--mds-bal-interval 0'

mkdir -p mnt/a/a
mkdir -p mnt/b/b
mkdir -p mnt/c/c
mkdir -p mnt/d/d
mkdir -p ./a/a
mkdir -p ./b/b
mkdir -p ./c/c
mkdir -p ./d/d

./ceph mds tell 0 export_dir /b 1
./ceph mds tell 0 export_dir /c 2
./ceph mds tell 0 export_dir /d 3
$CEPH_TOOL mds tell 0 export_dir /b 1
$CEPH_TOOL mds tell 0 export_dir /c 2
$CEPH_TOOL mds tell 0 export_dir /d 3
sleep 5

8 changes: 4 additions & 4 deletions qa/mds/rename/pri_nul.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh -ex

# srcdn=destdn
touch mnt/a/file1
mv mnt/a/file1 mnt/a/file1.renamed
touch ./a/file1
mv ./a/file1 ./a/file1.renamed

# different
touch mnt/a/file2
mv mnt/a/file2 mnt/b
touch ./a/file2
mv ./a/file2 ./b


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

# srcdn=destdn
touch mnt/a/file1
touch mnt/a/file2
mv mnt/a/file1 mnt/a/file2
touch ./a/file1
touch ./a/file2
mv ./a/file1 ./a/file2

# different (srcdn != destdn)
touch mnt/a/file3
touch mnt/b/file4
mv mnt/a/file3 mnt/b/file4
touch ./a/file3
touch ./b/file4
mv ./a/file3 ./b/file4

8 changes: 4 additions & 4 deletions qa/mds/rename/pri_rem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ dotest() {
destdn=$3
n=$4

touch mnt/$src/src$n
touch mnt/$desti/desti$n
ln mnt/$desti/desti$n mnt/$destdn/destdn$n
touch ./$src/src$n
touch ./$desti/desti$n
ln ./$desti/desti$n ./$destdn/destdn$n

mv mnt/$src/src$n mnt/$destdn/destdn$n
mv ./$src/src$n ./$destdn/destdn$n
}


Expand Down
6 changes: 3 additions & 3 deletions qa/mds/rename/rem_nul.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ dotest() {
dest=$3
n=$4

touch mnt/$srci/srci$n
ln mnt/$srci/srci$n mnt/$srcdn/srcdn$n
touch ./$srci/srci$n
ln ./$srci/srci$n ./$srcdn/srcdn$n

mv mnt/$srcdn/srcdn$n mnt/$dest/dest$n
mv ./$srcdn/srcdn$n ./$dest/dest$n
}

# srci=srcdn=destdn
Expand Down
8 changes: 4 additions & 4 deletions qa/mds/rename/rem_pri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ dotest() {
dest=$3
n=$4

touch mnt/$srci/srci$n
ln mnt/$srci/srci$n mnt/$srcdn/srcdn$n
touch mnt/$dest/dest$n
touch ./$srci/srci$n
ln ./$srci/srci$n ./$srcdn/srcdn$n
touch ./$dest/dest$n

mv mnt/$srcdn/srcdn$n mnt/$dest/dest$n
mv ./$srcdn/srcdn$n ./$dest/dest$n
}

# srci=srcdn=destdn
Expand Down
10 changes: 5 additions & 5 deletions qa/mds/rename/rem_rem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ dotest() {
destdn=$4
n=$5

touch mnt/$srci/srci$n
ln mnt/$srci/srci$n mnt/$srcdn/srcdn$n
touch mnt/$desti/desti$n
ln mnt/$desti/desti$n mnt/$destdn/destdn$n
touch ./$srci/srci$n
ln ./$srci/srci$n ./$srcdn/srcdn$n
touch ./$desti/desti$n
ln ./$desti/desti$n ./$destdn/destdn$n

mv mnt/$srcdn/srcdn$n mnt/$destdn/destdn$n
mv ./$srcdn/srcdn$n ./$destdn/destdn$n
}

# srci=srcdn=destdn=desti
Expand Down

0 comments on commit e483bb6

Please sign in to comment.