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