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