[sheepdog] [PATCH] tests/011: specify file system type

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Sep 6 14:11:33 CEST 2012


This also adds a '-J' option to use small journal size.  Otherwise,
the virtual nodes calculation becomes a different result from other
file system.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 tests/011 |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/tests/011 b/tests/011
index 9aeffa5..d3bc4d3 100755
--- a/tests/011
+++ b/tests/011
@@ -33,13 +33,21 @@ dd if=/dev/zero of=$STORE/0.img seek=$((2 * 1024 ** 3 - 1)) bs=1 count=1 > $seq.
 dd if=/dev/zero of=$STORE/1.img seek=$((4 * 1024 ** 3 - 1)) bs=1 count=1 > $seq.full 2>&1
 dd if=/dev/zero of=$STORE/2.img seek=$((8 * 1024 ** 3 - 1)) bs=1 count=1 > $seq.full 2>&1
 
-if [ "$(df -T / | grep ext)" ]; then
-    mkops="-q -F"
-elif [ "$(df -T / | grep xfs)" ]; then
-    mkops="-f"
-else
-    _die  "For now we only support xfs and ext*."
-fi
+fstype="$(df -T / | tail -1 | awk '{print $2}')"
+case $fstype in
+    ext2)
+        mkops="-t $fstype -q -F"
+        ;;
+    ext[3-4])
+        mkops="-t $fstype -q -F -J size=4"
+        ;;
+    xfs)
+        mkops="-t $fstype -f"
+        ;;
+    *)
+        _die  "For now we only support xfs and ext*."
+        ;;
+esac
 
 for i in 0 1 2; do
     mkfs $mkops $STORE/$i.img > $seq.full
-- 
1.7.2.5




More information about the sheepdog mailing list