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 | |
| 31 | $FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT1.new 2>&1 |
| 32 | status=$? |
| 33 | echo Exit status is $status >> $OUT1.new |
| 34 | sed -e '1d' $OUT1.new > $OUT1 |
| 35 | rm -f $OUT1.new |
| 36 | |
| 37 | if [ "$ONE_PASS_ONLY" != "true" ]; then |
| 38 | $FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1 |
| 39 | status=$? |
| 40 | echo Exit status is $status >> $OUT2.new |
| 41 | sed -e '1d' $OUT2.new > $OUT2 |
| 42 | rm -f $OUT2.new |
| 43 | fi |
| 44 | |
| 45 | rm $TMPFILE |
| 46 | |
| 47 | if [ "$SKIP_VERIFY" != "true" ] ; then |
| 48 | rm -f $test_name.ok $test_name.failed |
| 49 | cmp -s $OUT1 $EXP1 |
| 50 | status1=$? |
| 51 | if [ "$ONE_PASS_ONLY" != "true" ]; then |
| 52 | cmp -s $OUT2 $EXP2 |
| 53 | status2=$? |
| 54 | else |
| 55 | status2=0 |
| 56 | fi |
| 57 | |
| 58 | if [ "$status1" = 0 -a "$status2" = 0 ] ; then |
| 59 | echo "ok" |
| 60 | touch $test_name.ok |
| 61 | else |
| 62 | echo "failed" |
| 63 | diff -c $EXP1 $OUT1 > $test_name.failed |
| 64 | if [ "$ONE_PASS_ONLY" != "true" ]; then |
| 65 | diff -c $EXP2 $OUT2 >> $test_name.failed |
| 66 | fi |
| 67 | fi |
| 68 | fi |
| 69 | |
| 70 | if [ "$SKIP_CLEANUP" != "true" ] ; then |
| 71 | unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 |
| 72 | fi |