| 1 |
test_description="remove uninit_bg" |
| 2 |
OUT=$test_name.log |
| 3 |
FSCK_OPT=-yf |
| 4 |
EXP=$test_dir/expect |
| 5 |
|
| 6 |
os=$(uname -s) |
| 7 |
if [ "$os" = "Darwin" -o "$os" = "GNU" -o "FreeBSD" ]; then |
| 8 |
# creates a 10GB filesystem |
| 9 |
echo "$test_name: $test_description: skipped for $os" |
| 10 |
return 0 |
| 11 |
fi |
| 12 |
|
| 13 |
cp /dev/null $TMPFILE |
| 14 |
|
| 15 |
echo mke2fs -q -t ext4 -F -o Linux -b 1024 test.img 1G > $OUT.new |
| 16 |
$MKE2FS -q -t ext4 -F -o Linux -b 1024 $TMPFILE 1G >> $OUT.new 2>&1 |
| 17 |
|
| 18 |
echo "tune2fs -f -O ^uninit_bg test.img" >> $OUT.new |
| 19 |
$TUNE2FS -f -O ^uninit_bg $TMPFILE >> $OUT.new 2>&1 |
| 20 |
|
| 21 |
echo " " >> $OUT.new |
| 22 |
echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new |
| 23 |
$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 |
| 24 |
|
| 25 |
echo " " >> $OUT.new |
| 26 |
cp /dev/null $TMPFILE |
| 27 |
echo mke2fs -q -t ext4 -O bigalloc -F -o Linux -b 1024 -C 8192 test.img 10G >> $OUT.new |
| 28 |
$MKE2FS -q -t ext4 -O bigalloc -F -o Linux -b 1024 -C 8192 $TMPFILE 10G >> $OUT.new 2>&1 |
| 29 |
|
| 30 |
echo "tune2fs -f -O ^uninit_bg test.img" >> $OUT.new |
| 31 |
$TUNE2FS -f -O ^uninit_bg $TMPFILE >> $OUT.new 2>&1 |
| 32 |
|
| 33 |
echo " " >> $OUT.new |
| 34 |
echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new |
| 35 |
$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 |
| 36 |
sed -f $cmd_dir/filter.sed < $OUT.new > $OUT |
| 37 |
|
| 38 |
rm -f $TMPFILE $OUT.new |
| 39 |
|
| 40 |
# |
| 41 |
# Do the verification |
| 42 |
# |
| 43 |
|
| 44 |
cmp -s $OUT $EXP |
| 45 |
status=$? |
| 46 |
|
| 47 |
if [ "$status" = 0 ] ; then |
| 48 |
echo "$test_name: $test_description: ok" |
| 49 |
touch $test_name.ok |
| 50 |
else |
| 51 |
echo "$test_name: $test_description: failed" |
| 52 |
diff $DIFF_OPTS $EXP $OUT > $test_name.failed |
| 53 |
fi |
| 54 |
|
| 55 |
unset IMAGE FSCK_OPT OUT EXP |