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