blob: cd3029035e179fb2a6912b9e213bd4a01c6f451b [file] [log] [blame]
Theodore Ts'oa418d3a1997-04-26 14:00:26 +00001if [ "$IMAGE"x = x ]; then
2 IMAGE=$test_dir/image.gz
3fi
4
5if [ "$FSCK_OPT"x = x ]; then
6 FSCK_OPT=-yf
7fi
8
9if [ "$SECOND_FSCK_OPT"x = x ]; then
10 SECOND_FSCK_OPT=-yf
11fi
12
13if [ "$OUT1"x = x ]; then
14 OUT1=$test_name.1.log
15fi
16
17if [ "$OUT2"x = x ]; then
18 OUT2=$test_name.2.log
19fi
20
21if [ "$EXP1"x = x ]; then
22 EXP1=$test_dir/expect.1
23fi
24
25if [ "$EXP2"x = x ]; then
26 EXP2=$test_dir/expect.2
27fi
28
29gunzip < $IMAGE > $TMPFILE
30
Theodore Ts'o0444e151999-11-10 13:17:24 +000031eval $PREP_CMD
32
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000033$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT1.new 2>&1
34status=$?
35echo Exit status is $status >> $OUT1.new
36sed -e '1d' $OUT1.new > $OUT1
37rm -f $OUT1.new
38
39if [ "$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
43 sed -e '1d' $OUT2.new > $OUT2
44 rm -f $OUT2.new
45fi
46
47rm $TMPFILE
48
49if [ "$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
70fi
71
72if [ "$SKIP_CLEANUP" != "true" ] ; then
Theodore Ts'o0444e151999-11-10 13:17:24 +000073 unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 ONE_PASS_ONLY PREP_CMD
Theodore Ts'oa418d3a1997-04-26 14:00:26 +000074fi
Theodore Ts'o1e3472c1997-04-29 14:53:37 +000075