• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1if ! test -x $RESIZE2FS_EXE -o ! -x $DEBUGFS_EXE; then
2	echo "$test_name: $test_description: skipped (no debugfs/resize2fs)"
3	return 0
4fi
5
6OUT=$test_name.log
7if [ -f $test_dir/expect.gz ]; then
8	EXP=$test_name.tmp
9	gunzip < $test_dir/expect.gz > $EXP1
10else
11	EXP=$test_dir/expect
12fi
13
14echo mke2fs -q -F -t ext4 -o Linux -b 1024 test.img 32M > $OUT.new
15$MKE2FS -q -F -t ext4 -o Linux -b 1024 $TMPFILE 32M >> $OUT.new 2>&1
16
17echo debugfs -w -R \"set_bg 1 free_blocks_count 65536\" /tmp/foo.img >> $OUT.new
18$DEBUGFS -w -R "set_bg 1 free_blocks_count 65536" $TMPFILE > /dev/null 2>&1
19
20if timeout -v 1s true > /dev/null 2>&1 ; then
21   TIMEOUT="timeout -v 30s"
22else
23   TIMEOUT=
24fi
25
26echo resize2fs -P /tmp/foo.img >> $OUT.new
27$TIMEOUT $RESIZE2FS -P $TMPFILE  >> $OUT.new 2>&1
28
29sed -f $cmd_dir/filter.sed < $OUT.new > $OUT
30
31rm -f $TMPFILE $OUT.new
32
33cmp -s $OUT $EXP
34status=$?
35
36if [ "$status" = 0 ] ; then
37	echo "$test_name: $test_description: ok"
38	touch $test_name.ok
39else
40	echo "$test_name: $test_description: failed"
41	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
42	rm -f $test_name.tmp
43fi
44
45unset IMAGE OUT EXP TIMEOUT
46