]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - tests/m_mmp_bad_csum/script
misc: add e2mmpstatus utility via dumpe2fs
[thirdparty/e2fsprogs.git] / tests / m_mmp_bad_csum / script
CommitLineData
a8a1ee12
DW
1# use current directory instead of /tmp becase tmpfs doesn't support DIO
2rm -f $TMPFILE
3TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
4
5stat -f $TMPFILE | grep -q "Type: tmpfs"
6if [ $? = 0 ]; then
7 rm -f $TMPFILE
8 echo "$test_name: $test_description: skipped for tmpfs (no O_DIRECT)"
9 return 0
10fi
11gzip -dc < $test_dir/image.gz > $TMPFILE
12
63a801de 13OUT=$test_name.log
a8a1ee12 14EXP=$test_dir/expect
32b8802a 15$E2MMPSTATUS $TMPFILE > $OUT 2>&1
a8a1ee12 16echo Exit status is $? >> $OUT
32b8802a
SI
17$FSCK -fy $TMPFILE >> $OUT 2>&1
18echo Exit status is $? >> $OUT
19$E2MMPSTATUS $TMPFILE >> $OUT 2>&1
20echo Exit status is $? >> $OUT
21$E2MMPSTATUS -i $TMPFILE >> $OUT 2>&1
22sed -f $cmd_dir/filter.sed $OUT > $OUT.new
23mv $OUT.new $OUT
a8a1ee12
DW
24
25rm -f $TMPFILE
26cmp -s $OUT $EXP
27status=$?
28
29if [ "$status" = 0 ] ; then
30 echo "$test_name: $test_description: ok"
31 touch $test_name.ok
32else
33 echo "$test_name: $test_description: failed"
34 diff $DIFF_OPTS $EXP $OUT > $test_name.failed
35 rm -f $test_name.tmp
36fi
37unset OUT EXP