1 if [ "$DESCRIPTION"x != x ]; then
2 test_description="$DESCRIPTION"
4 if [ "$IMAGE"x = x ]; then
5 IMAGE=$test_dir/image.gz
8 if [ "$FSCK_OPT"x = x ]; then
12 if [ "$SECOND_FSCK_OPT"x = x ]; then
16 if [ "$OUT1"x = x ]; then
20 if [ "$OUT2"x = x ]; then
24 if [ "$EXP1"x = x ]; then
25 if [ -f $test_dir/expect.1.gz ]; then
27 gunzip < $test_dir/expect.1.gz > $EXP1
29 EXP1=$test_dir/expect.1
33 if [ "$EXP2"x = x ]; then
34 if [ -f $test_dir/expect.2.gz ]; then
36 gunzip < $test_dir/expect.2.gz > $EXP2
38 EXP2=$test_dir/expect.2
42 if [ "$SKIP_GUNZIP" != "true" ] ; then
43 gunzip < $IMAGE > $TMPFILE
50 echo 'stat /a' > $TMPFILE.cmd
51 echo 'ex /zero' >> $TMPFILE.cmd
52 $DEBUGFS -f $TMPFILE.cmd $TMPFILE > $OUT1.new 2>&1
54 $TUNE2FS -O extent $TMPFILE >> $OUT1.new 2>&1
55 $FSCK $FSCK_OPT -E bmap2extent -N test_filesys $TMPFILE >> $OUT1.new 2>&1
57 echo Exit status is $status >> $OUT1.new
58 sed -f $cmd_dir/filter.sed $OUT1.new > $OUT1
60 $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1
62 echo Exit status is $status >> $OUT2.new
63 echo 'ex /a' > $TMPFILE.cmd
64 echo 'ex /zero' >> $TMPFILE.cmd
65 $DEBUGFS -f $TMPFILE.cmd $TMPFILE >> $OUT2.new 2>&1
66 sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2
67 rm -f $TMPFILE.cmd $OUT1.new $OUT2.new
71 if [ "$SKIP_VERIFY" != "true" ] ; then
72 rm -f $test_name.ok $test_name.failed
75 if [ "$ONE_PASS_ONLY" != "true" ]; then
81 if [ "$PASS_ZERO" = "true" ]; then
82 cmp -s $test_name.0.log $test_dir/expect.0
88 if [ -z "$test_description" ] ; then
89 description="$test_name"
91 description="$test_name: $test_description"
94 if [ "$status1" -eq 0 -a "$status2" -eq 0 -a "$status3" -eq 0 ] ; then
95 echo "$description: ok"
98 echo "$description: failed"
99 rm -f $test_name.failed
100 if [ "$PASS_ZERO" = "true" ]; then
101 diff $DIFF_OPTS $test_dir/expect.0 \
102 $test_name.0.log >> $test_name.failed
104 diff $DIFF_OPTS $EXP1 $OUT1 >> $test_name.failed
105 if [ "$ONE_PASS_ONLY" != "true" ]; then
106 diff $DIFF_OPTS $EXP2 $OUT2 >> $test_name.failed
112 if [ "$SKIP_CLEANUP" != "true" ] ; then
113 unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2
114 unset SKIP_VERIFY SKIP_CLEANUP SKIP_GUNZIP ONE_PASS_ONLY PREP_CMD
115 unset DESCRIPTION SKIP_UNLINK AFTER_CMD PASS_ZERO