From 21795aaf5d16745cfce7478d773b969277ebb669 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 7 Jun 2011 20:49:45 -0700 Subject: [PATCH] qa: add dir rename tests Signed-off-by: Sage Weil --- qa/mds/rename/all.sh | 7 +++++++ qa/mds/rename/dir_pri_nul.sh | 21 +++++++++++++++++++++ qa/mds/rename/dir_pri_pri.sh | 11 +++++++++++ qa/mds/rename/pri_nul.sh | 19 ------------------- qa/mds/rename/pri_pri.sh | 9 --------- 5 files changed, 39 insertions(+), 28 deletions(-) create mode 100755 qa/mds/rename/dir_pri_nul.sh create mode 100644 qa/mds/rename/dir_pri_pri.sh diff --git a/qa/mds/rename/all.sh b/qa/mds/rename/all.sh index a5838c46e6c24..7df30f554e89f 100755 --- a/qa/mds/rename/all.sh +++ b/qa/mds/rename/all.sh @@ -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 + diff --git a/qa/mds/rename/dir_pri_nul.sh b/qa/mds/rename/dir_pri_nul.sh new file mode 100755 index 0000000000000..c768fe33d7e84 --- /dev/null +++ b/qa/mds/rename/dir_pri_nul.sh @@ -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 diff --git a/qa/mds/rename/dir_pri_pri.sh b/qa/mds/rename/dir_pri_pri.sh new file mode 100644 index 0000000000000..abb199a63200d --- /dev/null +++ b/qa/mds/rename/dir_pri_pri.sh @@ -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 diff --git a/qa/mds/rename/pri_nul.sh b/qa/mds/rename/pri_nul.sh index b3e407d046ca8..0a8ece2d2e0e2 100755 --- a/qa/mds/rename/pri_nul.sh +++ b/qa/mds/rename/pri_nul.sh @@ -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 diff --git a/qa/mds/rename/pri_pri.sh b/qa/mds/rename/pri_pri.sh index 86ea43da14324..4989ebc7cbddf 100755 --- a/qa/mds/rename/pri_pri.sh +++ b/qa/mds/rename/pri_pri.sh @@ -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 -- 2.39.5