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