• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
10cp /dev/null $OUT
11
12dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
13
14gzip -d < $test_dir/image.gz > $TMPFILE
15
16old="$($CRCSUM < $TMPFILE)"
17
18$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT.new 2>&1
19status=$?
20echo Exit status is $status >> $OUT.new
21sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
22rm -f $OUT.new
23
24new="$($CRCSUM < $TMPFILE)"
25
26if [ "${old}" != "${new}" ]; then
27	echo "ERROR: crc mismatch!  ${old} ${new}" >> $OUT
28else
29	echo "crc did not change.  ${old}" >> $OUT
30fi
31
32rm -f $TMPFILE
33
34cmp -s $OUT $EXP
35status=$?
36
37if [ "$status" = 0 ] ; then
38	echo "$test_name: $test_description: ok"
39	touch $test_name.ok
40else
41	echo "$test_name: $test_description: failed"
42	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
43	rm -f $test_name.tmp
44fi
45
46unset IMAGE FSCK_OPT OUT EXP old new
47