1if test -x $DEBUGFS_EXE; then 2 3FSCK_OPT=-fy 4OUT=$test_name.log 5if [ -f $test_dir/expect.gz ]; then 6 EXP=$test_name.tmp 7 gunzip < $test_dir/expect.gz > $EXP1 8else 9 EXP=$test_dir/expect 10fi 11 12cp /dev/null $OUT 13 14$MKE2FS -F -o Linux -b 1024 -O has_journal -T ext4 $TMPFILE 262144 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT 2>&1 15 16$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 17status=$? 18echo Exit status is $status >> $OUT.new 19sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT 20rm -f $OUT.new 21 22echo "debugfs write journal" >> $OUT 23echo "jo" > $TMPFILE.cmd 24echo "jw -b 259-4356 /dev/zero" >> $TMPFILE.cmd 25echo "jc" >> $TMPFILE.cmd 26echo "jo" >> $TMPFILE.cmd 27echo "jw -r 259-4356" >> $TMPFILE.cmd 28echo "jc" >> $TMPFILE.cmd 29$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null 30sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT 31rm -rf $OUT.new 32 33test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img" 34echo "logdump -c" > $TMPFILE.cmd 35$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT 36rm -rf $TMPFILE.cmd 37 38$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1 39status=$? 40echo Exit status is $status >> $OUT.new 41sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT 42rm -f $OUT.new 43 44rm -f $TMPFILE 45 46cmp -s $OUT $EXP 47status=$? 48 49if [ "$status" = 0 ] ; then 50 echo "$test_name: $test_description: ok" 51 touch $test_name.ok 52else 53 echo "$test_name: $test_description: failed" 54 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 55 rm -f $test_name.tmp 56fi 57 58unset IMAGE FSCK_OPT OUT EXP 59 60else #if test -x $DEBUGFS_EXE; then 61 echo "$test_name: $test_description: skipped" 62fi 63