1FSCK_OPT=-fn
2OUT=$test_name.log
3if [ -f $test_dir/expect.gz ]; then
4	EXP=$test_name.tmp
5	gunzip < $test_dir/expect.gz > $EXP1
6else
7	EXP=$test_dir/expect
8fi
9
10dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
11
12gzip -d < $test_dir/image.gz > $TMPFILE
13
14old="$($CRCSUM < $TMPFILE)"
15
16$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
17status=$?
18echo Exit status is $status >> $OUT.new
19
20new="$($CRCSUM < $TMPFILE)"
21
22if [ "${old}" != "${new}" ]; then
23	echo "ERROR: crc mismatch!  ${old} ${new}" >> $OUT.new
24else
25	echo "crc did not change.  ${old}" >> $OUT.new
26fi
27
28sed -f $cmd_dir/filter.sed $OUT.new > $OUT
29rm -f $TMPFILE $OUT.new
30
31cmp -s $OUT $EXP
32status=$?
33
34if [ "$status" = 0 ] ; then
35	echo "$test_name: $test_description: ok"
36	touch $test_name.ok
37else
38	echo "$test_name: $test_description: failed"
39	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
40	rm -f $test_name.tmp
41fi
42
43unset IMAGE FSCK_OPT OUT EXP old new
44