1 if test -x $DEBUGFS_EXE; then
5 if [ -f $test_dir/expect.gz ]; then
7 gunzip < $test_dir/expect.gz > $EXP1
14 $MKE2FS -F -o Linux -b 4096 -O 64bit,has_journal,metadata_csum -T ext4 $TMPFILE 131072 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT 2>&1
16 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
18 echo Exit status is $status >> $OUT.new
19 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
22 bitmaps="$($DUMPE2FS $TMPFILE 2>&1 | grep 'bitmap at' | sed -e 's/^.*bitmap at \([0-9]*\).*$/\1/g' | tr '\n' ',')"
24 $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT
26 echo "debugfs write journal" >> $OUT
27 echo "jo -c" > $TMPFILE.cmd
28 echo "jw -b 333,$bitmaps /dev/zero" >> $TMPFILE.cmd
29 echo "jc" >> $TMPFILE.cmd
30 echo "jo" >> $TMPFILE.cmd
31 echo "jw -r 333" >> $TMPFILE.cmd
32 echo "jc" >> $TMPFILE.cmd
33 $DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null
34 sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT
37 $DUMPE2FS $TMPFILE 2>&1 | grep '^Journal features:' >> $OUT
39 test -d "$JOURNAL_DUMP_DIR" -a -w "$JOURNAL_DUMP_DIR" && cp "$TMPFILE" "$JOURNAL_DUMP_DIR/$test_name.img"
40 echo "logdump -c" > $TMPFILE.cmd
41 $DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
44 echo "debugfs recover journal" >> $OUT
45 echo "jr" > $TMPFILE.cmd
46 $DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE 2>> $OUT.new > /dev/null
47 sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT
50 $FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
52 echo Exit status is $status >> $OUT.new
53 sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
56 rm -f $TMPFILE $TMPFILE.cmd
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
70 unset IMAGE FSCK_OPT OUT EXP
72 else #if test -x $DEBUGFS_EXE; then
73 echo "$test_name: $test_description: skipped"