1if ! test -x $DEBUGFS_EXE; then 2 echo "$test_name: $test_description: skipped (no debugfs)" 3 return 0 4fi 5 6IMAGE=$test_dir/../f_badcluster/image.gz 7OUT=$test_name.log 8EXP=$test_dir/expect 9gzip -d < $IMAGE > $TMPFILE 10$FSCK -fy $TMPFILE > $OUT.new 2>&1 11$FSCK -fy $TMPFILE >> $OUT.new 2>&1 12$FSCK -fy $TMPFILE >> $OUT.new 2>&1 13for i in a b c d e f g; do echo "stat /$i"; done > $TMPFILE.cmd 14echo "quit" >> $TMPFILE.cmd 15$DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 16sed -f $cmd_dir/filter.sed $OUT.new > $OUT 17rm -f $TMPFILE $TMPFILE.cmd $OUT.new 18 19cmp -s $OUT $EXP 20status=$? 21 22if [ "$status" = 0 ]; then 23 echo "$test_name: $test_description: ok" 24 touch $test_name.ok 25else 26 echo "$test_name: $test_description: failed" 27 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 28 rm -f $test_name.tmp 29fi 30