~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to tests/m_mmp_bad_magic/script

  • Committer: Daniel Mehrmann
  • Date: 2014-12-16 09:16:59 UTC
  • mfrom: (1.2.25)
  • Revision ID: daniel.mehrmann@gmx.de-20141216091659-ymhbl4ualba43vuc
Tags: 1.43-SN-2014-12-16-0ubuntu1
* Merge in snapshot from the maint branch 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# use current directory instead of /tmp becase tmpfs doesn't support DIO
 
2
rm -f $TMPFILE
 
3
TMPFILE=$(mktemp ./tmp-$test_name.XXXXXX)
 
4
 
 
5
stat -f $TMPFILE | grep -q "Type: tmpfs"
 
6
if [ $? = 0 ]; then
 
7
        rm -f $TMPFILE
 
8
        echo "$test_name: $test_description: skipped for tmpfs (no O_DIRECT)"
 
9
        return 0
 
10
fi
 
11
gzip -dc < $test_dir/image.gz > $TMPFILE
 
12
 
 
13
OUT=$test_name.log
 
14
EXP=$test_dir/expect
 
15
$FSCK -fy $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $OUT
 
16
echo Exit status is $? >> $OUT
 
17
 
 
18
rm -f $TMPFILE
 
19
cmp -s $OUT $EXP
 
20
status=$?
 
21
 
 
22
if [ "$status" = 0 ] ; then
 
23
        echo "$test_name: $test_description: ok"
 
24
        touch $test_name.ok
 
25
else
 
26
        echo "$test_name: $test_description: failed"
 
27
        diff $DIFF_OPTS $EXP $OUT > $test_name.failed
 
28
        rm -f $test_name.tmp
 
29
fi
 
30
unset OUT EXP