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