Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 1 | if [ "$IMAGE"x = x ]; then |
| 2 | IMAGE=$test_dir/image.gz |
| 3 | fi |
| 4 | |
| 5 | if [ "$FSCK_OPT"x = x ]; then |
| 6 | FSCK_OPT=-yf |
| 7 | fi |
| 8 | |
| 9 | if [ "$SECOND_FSCK_OPT"x = x ]; then |
| 10 | SECOND_FSCK_OPT=-yf |
| 11 | fi |
| 12 | |
| 13 | if [ "$OUT1"x = x ]; then |
| 14 | OUT1=$test_name.1.log |
| 15 | fi |
| 16 | |
| 17 | if [ "$OUT2"x = x ]; then |
| 18 | OUT2=$test_name.2.log |
| 19 | fi |
| 20 | |
| 21 | if [ "$EXP1"x = x ]; then |
| 22 | EXP1=$test_dir/expect.1 |
| 23 | fi |
| 24 | |
| 25 | if [ "$EXP2"x = x ]; then |
| 26 | EXP2=$test_dir/expect.2 |
| 27 | fi |
| 28 | |
| 29 | gunzip < $IMAGE > $TMPFILE |
| 30 | |
Theodore Ts'o | 0444e15 | 1999-11-10 13:17:24 +0000 | [diff] [blame] | 31 | eval $PREP_CMD |
| 32 | |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 33 | $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT1.new 2>&1 |
| 34 | status=$? |
| 35 | echo Exit status is $status >> $OUT1.new |
Theodore Ts'o | da1a022 | 2000-08-20 21:48:45 +0000 | [diff] [blame] | 36 | sed -e '1d' -e '/^JFS DEBUG:/d' $OUT1.new > $OUT1 |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 37 | rm -f $OUT1.new |
| 38 | |
| 39 | if [ "$ONE_PASS_ONLY" != "true" ]; then |
| 40 | $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 |
| 41 | status=$? |
| 42 | echo Exit status is $status >> $OUT2.new |
Theodore Ts'o | da1a022 | 2000-08-20 21:48:45 +0000 | [diff] [blame] | 43 | sed -e '1d' $OUT2.new -e '/^JFS DEBUG:/d' > $OUT2 |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 44 | rm -f $OUT2.new |
| 45 | fi |
| 46 | |
| 47 | rm $TMPFILE |
| 48 | |
| 49 | if [ "$SKIP_VERIFY" != "true" ] ; then |
| 50 | rm -f $test_name.ok $test_name.failed |
| 51 | cmp -s $OUT1 $EXP1 |
| 52 | status1=$? |
| 53 | if [ "$ONE_PASS_ONLY" != "true" ]; then |
| 54 | cmp -s $OUT2 $EXP2 |
| 55 | status2=$? |
| 56 | else |
| 57 | status2=0 |
| 58 | fi |
| 59 | |
| 60 | if [ "$status1" = 0 -a "$status2" = 0 ] ; then |
| 61 | echo "ok" |
| 62 | touch $test_name.ok |
| 63 | else |
| 64 | echo "failed" |
| 65 | diff -c $EXP1 $OUT1 > $test_name.failed |
| 66 | if [ "$ONE_PASS_ONLY" != "true" ]; then |
| 67 | diff -c $EXP2 $OUT2 >> $test_name.failed |
| 68 | fi |
| 69 | fi |
| 70 | fi |
| 71 | |
| 72 | if [ "$SKIP_CLEANUP" != "true" ] ; then |
Theodore Ts'o | 0444e15 | 1999-11-10 13:17:24 +0000 | [diff] [blame] | 73 | unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 ONE_PASS_ONLY PREP_CMD |
Theodore Ts'o | a418d3a | 1997-04-26 14:00:26 +0000 | [diff] [blame] | 74 | fi |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 75 | |