Whamcloud - gitweb
configure: update configure so it is generated using autoconf 2.71
[tools/e2fsprogs.git] / tests / run_e2fsck
index 573e010..e2c6596 100644 (file)
@@ -1,5 +1,5 @@
 if [ "$DESCRIPTION"x != x ]; then
-       printf "%s" "$DESCRIPTION: "
+       test_description="$DESCRIPTION"
 fi
 if [ "$IMAGE"x = x ]; then
        IMAGE=$test_dir/image.gz
@@ -23,7 +23,7 @@ fi
 
 if [ "$EXP1"x = x ]; then
        if [ -f $test_dir/expect.1.gz ]; then
-               EXP1=tmp_expect
+               EXP1=$test_name.1.tmp
                gunzip < $test_dir/expect.1.gz > $EXP1
        else
                EXP1=$test_dir/expect.1
@@ -32,7 +32,7 @@ fi
 
 if [ "$EXP2"x = x ]; then
        if [ -f $test_dir/expect.2.gz ]; then
-               EXP2=tmp_expect
+               EXP2=$test_name.2.tmp
                gunzip < $test_dir/expect.2.gz > $EXP2
        else
                EXP2=$test_dir/expect.2
@@ -47,28 +47,22 @@ cp /dev/null $OUT1
 
 eval $PREP_CMD
 
-$FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT1.new 2>&1
+$FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT1.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT1.new
-sed -e '1d' $OUT1.new | sed -e '/^JFS DEBUG:/d' | \
-           sed -e "s;$TMPFILE;test.img;" | tr -d \\015 >> $OUT1
+sed -f $cmd_dir/filter.sed $OUT1.new >> $OUT1
 rm -f $OUT1.new
 
 if [ "$ONE_PASS_ONLY" != "true" ]; then
        $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 
        status=$?
        echo Exit status is $status >> $OUT2.new
-       sed -e '1d' $OUT2.new | sed -e '/^JFS DEBUG:/d' | \
-           sed -e "s;$TMPFILE;test.img;" > $OUT2
+       sed -f $cmd_dir/filter.sed $OUT2.new > $OUT2
        rm -f $OUT2.new
 fi
 
 eval $AFTER_CMD
 
-if [ "$SKIP_UNLINK" != "true" ] ; then
-       rm $TMPFILE
-fi
-
 if [ "$SKIP_VERIFY" != "true" ] ; then
        rm -f $test_name.ok $test_name.failed
        cmp -s $OUT1 $EXP1
@@ -86,12 +80,23 @@ if [ "$SKIP_VERIFY" != "true" ] ; then
                status3=0
        fi
 
+       if [ -z "$test_description" ] ; then
+               description="$test_name"
+       else
+               description="$test_name: $test_description"
+       fi
+
        if [ "$status1" -eq 0 -a "$status2" -eq 0 -a "$status3" -eq 0 ] ; then
-               echo "ok"
+               echo "$description: ok"
                touch $test_name.ok
        else
-               echo "failed"
-               diff $DIFF_OPTS $EXP1 $OUT1 > $test_name.failed
+               echo "$description: failed"
+               rm -f $test_name.failed
+               if [ "$PASS_ZERO" = "true" ]; then
+                       diff $DIFF_OPTS $test_dir/expect.0 \
+                               $test_name.0.log >> $test_name.failed
+               fi
+               diff $DIFF_OPTS $EXP1 $OUT1 >> $test_name.failed
                if [ "$ONE_PASS_ONLY" != "true" ]; then
                        diff $DIFF_OPTS $EXP2 $OUT2 >> $test_name.failed
                fi