Home | History | Annotate | Download | only in m_mmp_bad_csum
      1 # use current directory instead of /tmp becase tmpfs doesn't support DIO
      2 rm -f $TMPFILE
      3 TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
      4 
      5 stat -f $TMPFILE | grep -q "Type: tmpfs"
      6 if [ $? = 0 ]; then
      7 	rm -f $TMPFILE
      8 	echo "$test_name: $test_description: skipped for tmpfs (no O_DIRECT)"
      9 	return 0
     10 fi
     11 gzip -dc < $test_dir/image.gz > $TMPFILE
     12 
     13 OUT=$test_name.log
     14 EXP=$test_dir/expect
     15 $E2MMPSTATUS $TMPFILE > $OUT 2>&1
     16 echo Exit status is $? >> $OUT
     17 $FSCK -fy $TMPFILE >> $OUT 2>&1
     18 echo Exit status is $? >> $OUT
     19 $E2MMPSTATUS $TMPFILE >> $OUT 2>&1
     20 echo Exit status is $? >> $OUT
     21 $E2MMPSTATUS -i $TMPFILE >> $OUT 2>&1
     22 sed -f $cmd_dir/filter.sed $OUT > $OUT.new
     23 mv $OUT.new $OUT
     24 
     25 rm -f $TMPFILE
     26 cmp -s $OUT $EXP
     27 status=$?
     28 
     29 if [ "$status" = 0 ] ; then
     30 	echo "$test_name: $test_description: ok"
     31 	touch $test_name.ok
     32 else
     33 	echo "$test_name: $test_description: failed"
     34 	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
     35 	rm -f $test_name.tmp
     36 fi
     37 unset OUT EXP
     38