1 if ! test -x $DEBUGFS_EXE; then
2 echo "$test_name: $test_description: skipped (no debugfs)"
10 TEST_DATA=$test_name.tmp
11 VERIFY_DATA=$test_name.ver.tmp
13 echo "debugfs load/dump test" > $OUT
15 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
17 echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT
19 $MKE2FS -Fq -b 1024 $TMPFILE 512 > /dev/null 2>&1
21 echo Exit status is $status >> $OUT
23 dd if=$TEST_BITS of=$TEST_DATA bs=128k count=1 conv=sync > /dev/null 2>&1
24 echo "file fragment odd size" >> $TEST_DATA
26 echo "debugfs -R ''write $TEST_DATA test_data'' -w test.img" > $OUT.new
27 $DEBUGFS -R "write $TEST_DATA test_data" -w $TMPFILE >> $OUT.new 2>&1
29 echo Exit status is $status >> $OUT.new
30 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
32 echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new
33 $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1
35 echo Exit status is $status >> $OUT.new
36 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
38 echo "debugfs -R ''dump test_data $VERIFY_DATA'' test.img" > $OUT.new
39 $DEBUGFS -R "dump test_data $VERIFY_DATA" $TMPFILE >> $OUT.new 2>&1
41 echo Exit status is $status >> $OUT.new
42 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
44 echo "cmp $TEST_DATA $VERIFY_DATA" >> $OUT
45 cmp $TEST_DATA $VERIFY_DATA >>$OUT
47 echo Exit status is $status >> $OUT
53 if [ "$SKIP_UNLINK" != "true" ]; then
54 rm -f $VERIFY_DATA $TEST_DATA $TMPFILE $OUT.new
56 echo "TMPFILE=$TMPFILE"
61 if [ "$status" = 0 ] ; then
62 echo "$test_name: $test_description: ok"
65 echo "$test_name: $test_description: failed"
66 diff $DIFF_OPTS $EXP $OUT > $test_name.failed
69 unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA