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