diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-20 22:12:11 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-20 22:12:11 +0200 |
commit | 5e1dbd5bc3c609c73037a41546c5ead240821558 (patch) | |
tree | 272c8328e8bbcae97c7487b6a9efc99b98b8f536 /util-linux/mkfs_ext2_test.sh | |
parent | e707a3000b2f6e2f684b6e85cd60590318d157c4 (diff) | |
download | busybox-w32-5e1dbd5bc3c609c73037a41546c5ead240821558.tar.gz busybox-w32-5e1dbd5bc3c609c73037a41546c5ead240821558.tar.bz2 busybox-w32-5e1dbd5bc3c609c73037a41546c5ead240821558.zip |
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-x | util-linux/mkfs_ext2_test.sh | 68 |
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 | |||
7 | >$2 | 7 | >$2 |
8 | dd seek=$((kilobytes-1)) bs=1K count=1 </dev/zero of=$2 >/dev/null 2>&1 || exit 1 | 8 | dd seek=$((kilobytes-1)) bs=1K count=1 </dev/zero of=$2 >/dev/null 2>&1 || exit 1 |
9 | $1 -F $2 $kilobytes >$2.raw_out 2>&1 || return 1 | 9 | $1 -F $2 $kilobytes >$2.raw_out 2>&1 || return 1 |
10 | |||
11 | #off | sed 's/inodes, [0-9]* blocks/inodes, N blocks/' \ | ||
12 | |||
13 | cat $2.raw_out \ | 10 | cat $2.raw_out \ |
14 | | grep -v '^mke2fs [0-9]*\.[0-9]*\.[0-9]* ' \ | 11 | | grep -v '^mke2fs [0-9]*\.[0-9]*\.[0-9]* ' \ |
15 | | grep -v '^Maximum filesystem' \ | 12 | | grep -v '^Maximum filesystem' \ |
@@ -55,54 +52,51 @@ done | |||
55 | 52 | ||
56 | # Transition from one block group to two | 53 | # Transition from one block group to two |
57 | # fails in [8378..8410] range | 54 | # fails in [8378..8410] range |
58 | kilobytes=$((8*1024 - 20)) | 55 | kilobytes=$((1 * 8*1024 - 50)) |
59 | while true; do | 56 | while true; do |
60 | test_mke2fs #|| exit 1 | 57 | test_mke2fs #|| exit 1 |
61 | : $((kilobytes++)) | 58 | : $((kilobytes++)) |
62 | test $kilobytes = $((8*1024 + 300)) && break | 59 | test $kilobytes = $((1 * 8*1024 + 300)) && break |
63 | done | 60 | done |
64 | 61 | ||
65 | # Transition from two block groups to three | 62 | # Transition from 2 block groups to 3 |
66 | # works | 63 | # works |
67 | kilobytes=$((16*1024 - 40)) | 64 | kilobytes=$((2 * 8*1024 - 50)) |
68 | while true; do | 65 | while true; do |
69 | test_mke2fs || exit 1 | 66 | test_mke2fs || exit 1 |
70 | : $((kilobytes++)) | 67 | : $((kilobytes++)) |
71 | test $kilobytes = $((16*1024 + 500)) && break | 68 | test $kilobytes = $((2 * 8*1024 + 400)) && break |
72 | done | 69 | done |
73 | exit | ||
74 | |||
75 | # Specific sizes with known differences: | ||
76 | |||
77 | # -6240 inodes, 24908 blocks | ||
78 | # +6240 inodes, 24577 blocks | ||
79 | # -4 block group | ||
80 | # +3 block group | ||
81 | # -1560 inodes per group | ||
82 | # +2080 inodes per group | ||
83 | kilobytes=24908 test_mke2fs | ||
84 | 70 | ||
85 | # -304 inodes, N blocks | 71 | # Transition from 3 block groups to 4 |
86 | # +152 inodes, N blocks | 72 | # fails in [24825..24922] range |
87 | # -304 inodes per group | 73 | kilobytes=$((3 * 8*1024 - 50)) |
88 | # +152 inodes per group | 74 | while true; do |
89 | kilobytes=1218 test_mke2fs | 75 | test_mke2fs #|| exit 1 |
90 | 76 | : $((kilobytes++)) | |
91 | # -14464 inodes, N blocks | 77 | test $kilobytes = $((3 * 8*1024 + 500)) && break |
92 | # +14448 inodes, N blocks | 78 | done |
93 | # -8 block group | ||
94 | # +7 block group | ||
95 | # -1808 inodes per group | ||
96 | # +2064 inodes per group | ||
97 | kilobytes=57696 test_mke2fs | ||
98 | 79 | ||
99 | # -warning: 239 blocks unused. | 80 | # Transition from 4 block groups to 5 |
100 | # +warning: 242 blocks unused. | 81 | # works |
101 | kilobytes=49395 test_mke2fs | 82 | kilobytes=$((4 * 8*1024 - 50)) |
83 | while true; do | ||
84 | test_mke2fs || exit 1 | ||
85 | : $((kilobytes++)) | ||
86 | test $kilobytes = $((4 * 8*1024 + 600)) && break | ||
87 | done | ||
102 | 88 | ||
103 | ## This size results in "warning: 75 blocks unused" | 89 | # Transition from 5 block groups to 6 |
104 | #kilobytes=98380 test_mke2fs | 90 | # fails in [41230..41391] range |
91 | kilobytes=$((5 * 8*1024 - 50)) | ||
92 | while true; do | ||
93 | test_mke2fs #|| exit 1 | ||
94 | : $((kilobytes++)) | ||
95 | test $kilobytes = $((5 * 8*1024 + 700)) && break | ||
96 | done | ||
97 | exit | ||
105 | 98 | ||
99 | # Random sizes | ||
106 | while true; do | 100 | while true; do |
107 | kilobytes=$(( (RANDOM*RANDOM) % 1000000 + 60)) | 101 | kilobytes=$(( (RANDOM*RANDOM) % 1000000 + 60)) |
108 | test_mke2fs || exit 1 | 102 | test_mke2fs || exit 1 |