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