~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to tests/j_corrupt_revoke_csum/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
if test -x $DEBUGFS_EXE; then
 
2
 
 
3
IMAGE=$test_dir/image.gz
 
4
FSCK_OPT=-fy
 
5
OUT=$test_name.log
 
6
if [ -f $test_dir/expect.gz ]; then
 
7
        EXP=$test_name.tmp
 
8
        gunzip < $test_dir/expect.gz > $EXP1
 
9
else
 
10
        EXP=$test_dir/expect
 
11
fi
 
12
 
 
13
cp /dev/null $OUT
 
14
 
 
15
gzip -d < $IMAGE > $TMPFILE
 
16
 
 
17
$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 
18
status=$?
 
19
echo Exit status is $status >> $OUT.new
 
20
sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
 
21
rm -f $OUT.new
 
22
 
 
23
$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
 
24
status=$?
 
25
echo Exit status is $status >> $OUT.new
 
26
sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
 
27
rm -f $OUT.new
 
28
 
 
29
echo "cat /a" > $TMPFILE.cmd
 
30
echo >> $TMPFILE.cmd
 
31
$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
 
32
rm -f $TMPFILE.cmd
 
33
 
 
34
rm -f $TMPFILE
 
35
 
 
36
cmp -s $OUT $EXP
 
37
status=$?
 
38
 
 
39
if [ "$status" = 0 ] ; then
 
40
        echo "$test_name: $test_description: ok"
 
41
        touch $test_name.ok
 
42
else
 
43
        echo "$test_name: $test_description: failed"
 
44
        diff $DIFF_OPTS $EXP $OUT > $test_name.failed
 
45
        rm -f $test_name.tmp
 
46
fi
 
47
 
 
48
unset IMAGE FSCK_OPT OUT EXP
 
49
 
 
50
else #if test -x $DEBUGFS_EXE; then
 
51
        echo "$test_name: $test_description: skipped"
 
52
fi