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