• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
13
14echo mke2fs -q -t ext4 -F -o Linux -b 1024 test.img 1G > $OUT.new
15$MKE2FS -q -t ext4 -F -o Linux -b 1024 $TMPFILE 1G >> $OUT.new 2>&1
16
17echo "tune2fs -f -O ^uninit_bg test.img" >> $OUT.new
18$TUNE2FS -f -O ^uninit_bg $TMPFILE >> $OUT.new 2>&1
19
20echo " " >> $OUT.new
21echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new
22$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
23
24echo " " >> $OUT.new
25cp /dev/null $TMPFILE
26echo mke2fs -q -t ext4 -O bigalloc -F -o Linux -b 1024 -C 8192 test.img 10G >> $OUT.new
27$MKE2FS -q -t ext4 -O bigalloc -F -o Linux -b 1024 -C 8192 $TMPFILE 10G >> $OUT.new 2>&1
28
29echo "tune2fs -f -O ^uninit_bg test.img" >> $OUT.new
30$TUNE2FS -f -O ^uninit_bg $TMPFILE >> $OUT.new 2>&1
31
32echo " " >> $OUT.new
33echo fsck $FSCK_OPT -N test_filesys test.img >> $OUT.new
34$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
35sed -f $cmd_dir/filter.sed < $OUT.new > $OUT
36
37rm -f $TMPFILE $OUT.new
38
39#
40# Do the verification
41#
42
43cmp -s $OUT $EXP
44status=$?
45
46if [ "$status" = 0 ] ; then
47	echo "$test_name: $test_description: ok"
48	touch $test_name.ok
49else
50	echo "$test_name: $test_description: failed"
51	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
52fi
53
54unset IMAGE FSCK_OPT OUT EXP
55