blob: 4923c6623b194f984e43cbbfc4600f5819f034f9 [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
31$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT1.new 2>&1
32status=$?
33echo Exit status is $status >> $OUT1.new
34sed -e '1d' $OUT1.new > $OUT1
35rm -f $OUT1.new
36
37if [ "$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
43fi
44
45rm $TMPFILE
46
47if [ "$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
68fi
69
70if [ "$SKIP_CLEANUP" != "true" ] ; then
71 unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2
72fi