aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mkfs_ext2_test.sh
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-10-20 22:12:11 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-10-20 22:12:11 +0200
commit5e1dbd5bc3c609c73037a41546c5ead240821558 (patch)
tree272c8328e8bbcae97c7487b6a9efc99b98b8f536 /util-linux/mkfs_ext2_test.sh
parente707a3000b2f6e2f684b6e85cd60590318d157c4 (diff)
downloadbusybox-5e1dbd5bc3c609c73037a41546c5ead240821558.tar.gz
mkfs_ext2: another update by Vladimir
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/mkfs_ext2_test.sh')
-rwxr-xr-xutil-linux/mkfs_ext2_test.sh68
1 files changed, 31 insertions, 37 deletions
diff --git a/util-linux/mkfs_ext2_test.sh b/util-linux/mkfs_ext2_test.sh
index a636de561..0aa98185a 100755
--- a/util-linux/mkfs_ext2_test.sh
+++ b/util-linux/mkfs_ext2_test.sh
@@ -7,9 +7,6 @@ gen_image() { # params: mke2fs_invocation image_name
>$2
dd seek=$((kilobytes-1)) bs=1K count=1 </dev/zero of=$2 >/dev/null 2>&1 || exit 1
$1 -F $2 $kilobytes >$2.raw_out 2>&1 || return 1
-
-#off | sed 's/inodes, [0-9]* blocks/inodes, N blocks/' \
-
cat $2.raw_out \
| grep -v '^mke2fs [0-9]*\.[0-9]*\.[0-9]* ' \
| grep -v '^Maximum filesystem' \
@@ -55,54 +52,51 @@ done
# Transition from one block group to two
# fails in [8378..8410] range
-kilobytes=$((8*1024 - 20))
+kilobytes=$((1 * 8*1024 - 50))
while true; do
test_mke2fs #|| exit 1
: $((kilobytes++))
- test $kilobytes = $((8*1024 + 300)) && break
+ test $kilobytes = $((1 * 8*1024 + 300)) && break
done
-# Transition from two block groups to three
+# Transition from 2 block groups to 3
# works
-kilobytes=$((16*1024 - 40))
+kilobytes=$((2 * 8*1024 - 50))
while true; do
test_mke2fs || exit 1
: $((kilobytes++))
- test $kilobytes = $((16*1024 + 500)) && break
+ test $kilobytes = $((2 * 8*1024 + 400)) && break
done
-exit
-
-# Specific sizes with known differences:
-
-# -6240 inodes, 24908 blocks
-# +6240 inodes, 24577 blocks
-# -4 block group
-# +3 block group
-# -1560 inodes per group
-# +2080 inodes per group
-kilobytes=24908 test_mke2fs
-# -304 inodes, N blocks
-# +152 inodes, N blocks
-# -304 inodes per group
-# +152 inodes per group
-kilobytes=1218 test_mke2fs
-
-# -14464 inodes, N blocks
-# +14448 inodes, N blocks
-# -8 block group
-# +7 block group
-# -1808 inodes per group
-# +2064 inodes per group
-kilobytes=57696 test_mke2fs
+# Transition from 3 block groups to 4
+# fails in [24825..24922] range
+kilobytes=$((3 * 8*1024 - 50))
+while true; do
+ test_mke2fs #|| exit 1
+ : $((kilobytes++))
+ test $kilobytes = $((3 * 8*1024 + 500)) && break
+done
-# -warning: 239 blocks unused.
-# +warning: 242 blocks unused.
-kilobytes=49395 test_mke2fs
+# Transition from 4 block groups to 5
+# works
+kilobytes=$((4 * 8*1024 - 50))
+while true; do
+ test_mke2fs || exit 1
+ : $((kilobytes++))
+ test $kilobytes = $((4 * 8*1024 + 600)) && break
+done
-## This size results in "warning: 75 blocks unused"
-#kilobytes=98380 test_mke2fs
+# Transition from 5 block groups to 6
+# fails in [41230..41391] range
+kilobytes=$((5 * 8*1024 - 50))
+while true; do
+ test_mke2fs #|| exit 1
+ : $((kilobytes++))
+ test $kilobytes = $((5 * 8*1024 + 700)) && break
+done
+exit
+# Random sizes
while true; do
kilobytes=$(( (RANDOM*RANDOM) % 1000000 + 60))
test_mke2fs || exit 1