summaryrefslogtreecommitdiff
path: root/qa/mds
diff options
context:
space:
mode:
authorGreg Farnum <gregory.farnum@dreamhost.com>2011-06-28 10:35:05 -0700
committerGreg Farnum <gregory.farnum@dreamhost.com>2011-06-28 10:36:26 -0700
commit033f2d6327f30d431231923112da6abc353b084b (patch)
treefca635565006a5562b24ef145a18b83c007f7687 /qa/mds
parent0568d5cb507f344e8add4f8ea2e5e60140a158a9 (diff)
downloadceph-033f2d6327f30d431231923112da6abc353b084b.tar.gz
qa: add file_layout.sh workunit
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Diffstat (limited to 'qa/mds')
-rw-r--r--qa/mds/file_layout.sh32
1 files changed, 28 insertions, 4 deletions
diff --git a/qa/mds/file_layout.sh b/qa/mds/file_layout.sh
index 63808f405a2..8a5877db908 100644
--- a/qa/mds/file_layout.sh
+++ b/qa/mds/file_layout.sh
@@ -3,14 +3,38 @@
MB=1048576
twoMB=$((2*MB))
+rm -r layout_test || true
+rm new_layout || true
+rm file2_layout || true
+rm temp || true
+
+echo "layout.data_pool: 0
+layout.object_size: 1048576
+layout.stripe_unit: 1048576
+layout.stripe_count: 1
+layout.preferred_osd: -1" > new_layout
+echo "layout.data_pool: 0
+layout.object_size: 2097152
+layout.stripe_unit: 1048576
+layout.stripe_count: 2
+layout.preferred_osd: -1" > file2_layout
+
mkdir layout_test
./cephfs layout_test show_layout
./cephfs layout_test set_layout -u $MB -c 1 -s $MB
touch layout_test/file1
-./cephfs layout_test/file1 show_layout
+./cephfs layout_test/file1 show_layout > temp
+diff new_layout temp || return 1
`echo "hello, I'm a file" > layout_test/file1`
-./cephfs layout_test/file1 show_layout
+./cephfs layout_test/file1 show_layout > temp
+diff new_layout temp || return 1
touch layout_test/file2
-./cephfs layout_test/file2 show_layout
+./cephfs layout_test/file2 show_layout > temp
+diff new_layout temp || return 1
./cephfs layout_test/file2 set_layout -u $MB -c 2 -s $twoMB
-./cephfs layout_test/file2 show_layout \ No newline at end of file
+./cephfs layout_test/file2 show_layout > temp
+diff file2_layout temp || return 1
+
+echo "hello, I'm a file with a custom layout" > layout_test/file2
+sync
+echo "Completed all file layout tests!" \ No newline at end of file