Home | History | Annotate | Download | only in d_loaddump
      1 if test -x $DEBUGFS_EXE; then
      2 
      3 OUT=$test_name.log
      4 EXP=$test_dir/expect
      5 VERIFY_FSCK_OPT=-yf
      6 
      7 TEST_DATA=$test_name.tmp
      8 VERIFY_DATA=$test_name.ver.tmp
      9 
     10 echo "debugfs load/dump test" > $OUT
     11 
     12 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
     13 
     14 echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT
     15 
     16 $MKE2FS -Fq $TMPFILE 512 > /dev/null 2>&1
     17 status=$?
     18 echo Exit status is $status >> $OUT
     19 
     20 dd if=$TEST_BITS of=$TEST_DATA bs=128k count=1 conv=sync > /dev/null 2>&1 
     21 echo "file fragment odd size" >> $TEST_DATA
     22 
     23 echo "debugfs -R ''write $TEST_DATA test_data'' -w test.img" > $OUT.new
     24 $DEBUGFS -R "write $TEST_DATA test_data" -w $TMPFILE >> $OUT.new 2>&1
     25 status=$?
     26 echo Exit status is $status >> $OUT.new
     27 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
     28 
     29 echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
     30 $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
     31 status=$?
     32 echo Exit status is $status >> $OUT.new
     33 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
     34 
     35 echo "debugfs -R ''dump test_data $VERIFY_DATA'' test.img" > $OUT.new
     36 $DEBUGFS -R "dump test_data $VERIFY_DATA" $TMPFILE >> $OUT.new 2>&1
     37 status=$?
     38 echo Exit status is $status >> $OUT.new
     39 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
     40 
     41 echo "cmp $TEST_DATA $VERIFY_DATA" >> $OUT
     42 cmp $TEST_DATA $VERIFY_DATA >>$OUT
     43 status=$?
     44 echo Exit status is $status >> $OUT
     45 
     46 #
     47 # Do the verification
     48 #
     49 
     50 rm -f $VERIFY_DATA $TEST_DATA $TMPFILE $OUT.new
     51 cmp -s $OUT $EXP
     52 status=$?
     53 
     54 if [ "$status" = 0 ] ; then
     55 	echo "$test_name: $test_description: ok"
     56 	touch $test_name.ok
     57 else
     58 	echo "$test_name: $test_description: failed"
     59 	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
     60 fi
     61 
     62 unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA
     63 
     64 else #if test -x $DEBUGFS_EXE; then
     65 	echo "$test_name: $test_description: skipped"
     66 fi 
     67