Whamcloud - gitweb
Fix gcc -Wall nits.
[tools/e2fsprogs.git] / tests / run_e2fsck
index 91277e1..e76bfae 100644 (file)
@@ -1,3 +1,6 @@
+if [ "$DESCRIPTION"x != x ]; then
+       echo -n "$DESCRIPTION: "
+fi
 if [ "$IMAGE"x = x ]; then
        IMAGE=$test_dir/image.gz
 fi
@@ -19,30 +22,50 @@ if [ "$OUT2"x = x ]; then
 fi
 
 if [ "$EXP1"x = x ]; then
-       EXP1=$test_dir/expect.1
+       if [ -f $test_dir/expect.1.gz ]; then
+               EXP1=tmp_expect
+               gunzip < $test_dir/expect.1.gz > $EXP1
+       else
+               EXP1=$test_dir/expect.1
+       fi
 fi
 
 if [ "$EXP2"x = x ]; then
-       EXP2=$test_dir/expect.2
+       if [ -f $test_dir/expect.2.gz ]; then
+               EXP2=tmp_expect
+               gunzip < $test_dir/expect.2.gz > $EXP2
+       else
+               EXP2=$test_dir/expect.2
+       fi
 fi
 
-gunzip < $IMAGE > $TMPFILE
+if [ "$SKIP_GUNZIP" != "true" ] ; then
+       gunzip < $IMAGE > $TMPFILE
+fi
+
+cp /dev/null $OUT1
+
+eval $PREP_CMD
 
 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE > $OUT1.new 2>&1
 status=$?
 echo Exit status is $status >> $OUT1.new
-sed -e '1d' $OUT1.new > $OUT1
+sed -e '1d' $OUT1.new | sed -e '/^JFS DEBUG:/d'  | tr -d \\015 >> $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 > $OUT2
+       sed -e '1d' $OUT2.new | sed -e '/^JFS DEBUG:/d'  > $OUT2
        rm -f $OUT2.new
 fi
 
-rm $TMPFILE
+eval $AFTER_CMD
+
+if [ "$SKIP_UNLINK" != "true" ] ; then
+       rm $TMPFILE
+fi
 
 if [ "$SKIP_VERIFY" != "true" ] ; then
        rm -f $test_name.ok $test_name.failed
@@ -65,9 +88,12 @@ if [ "$SKIP_VERIFY" != "true" ] ; then
                        diff -c $EXP2 $OUT2 >> $test_name.failed
                fi
        fi
+       rm -f tmp_expect
 fi
 
 if [ "$SKIP_CLEANUP" != "true" ] ; then
-       unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 ONE_PASS_ONLY
+       unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 
+       unset SKIP_VERIFY SKIP_CLEANUP SKIP_GUNZIP ONE_PASS_ONLY PREP_CMD
+       unset DESCRIPTION SKIP_UNLINK AFTER_CMD
 fi