• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then
2
3FSCK_OPT=-fn
4OUT=$test_name.log
5EXP=$test_dir/expect
6CONF=$TMPFILE.conf
7
8cat > $CONF << ENDL
9[fs_types]
10	ext4h = {
11		features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit
12		blocksize = 1024
13		inode_size = 256
14		make_hugefiles = true
15		hugefiles_dir = /
16		hugefiles_slack = 0
17		hugefiles_name = aaaaa
18		hugefiles_digits = 4
19		hugefiles_size = 1M
20		zero_hugefiles = false
21	}
22ENDL
23
24echo "resize2fs test" > $OUT
25
26MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h $TMPFILE 524288 >> $OUT 2>&1
27rm -rf $CONF
28
29# dump and check
30($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.before
31$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1
32status=$?
33echo Exit status is $status >> $OUT
34
35# resize it
36echo "resize2fs test.img -s" >> $OUT
37$RESIZE2FS -s -f $TMPFILE 2>&1 >> $OUT 2>&1
38status=$?
39echo Exit status is $status >> $OUT
40
41# dump and check
42($DUMPE2FS -h $TMPFILE; $DUMPE2FS -g $TMPFILE) 2> /dev/null | sed -f $cmd_dir/filter.sed > $OUT.after
43echo "Change in FS metadata:" >> $OUT
44diff -u $OUT.before $OUT.after | tail -n +3 >> $OUT
45$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1
46status=$?
47echo Exit status is $status >> $OUT
48
49rm $TMPFILE
50
51#
52# Do the verification
53#
54
55sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' < $OUT > $OUT.new
56mv $OUT.new $OUT
57
58cmp -s $OUT $EXP
59status=$?
60
61if [ "$status" = 0 ] ; then
62	echo "$test_name: $test_description: ok"
63	touch $test_name.ok
64else
65	echo "$test_name: $test_description: failed"
66	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
67fi
68
69rm $OUT.before $OUT.after
70
71unset IMAGE FSCK_OPT OUT EXP CONF
72
73else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then
74	echo "$test_name: $test_description: skipped"
75fi
76
77