1 if ! test -x $DEBUGFS_EXE; then
2 echo "$test_name: $test_description: skipped (no debugfs)"
8 if [ -f $test_dir/expect.gz ]; then
10 gunzip < $test_dir/expect.gz > $EXP1
15 $MKE2FS -F -o Linux -b 4096 -O has_journal -T ext4 $TMPFILE 65536 > $OUT.new 2>&1
17 $FSCK -fy -N test_filesys $TMPFILE >> $OUT.new 2>&1
19 echo Exit status is $status >> $OUT.new
21 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
23 echo "debugfs write journal" >> $OUT.new
24 echo "jo" > $TMPFILE.cmd
25 echo "jw -b $bitmaps /dev/zero" >> $TMPFILE.cmd
26 echo "jc" >> $TMPFILE.cmd
27 $DEBUGFS -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null
29 test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img"
30 echo "logdump -c" > $TMPFILE.cmd
31 $DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1
33 $FSCK -fy -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
37 rm -f $TMPFILE $TMPFILE.cmd $OUT.new
42 if [ "$status" = 0 ] ; then
43 echo "$test_name: $test_description: ok"
46 echo "$test_name: $test_description: failed"
47 diff $DIFF_OPTS $EXP $OUT > $test_name.failed
51 unset IMAGE FSCK_OPT OUT EXP